while((event = get_expired_event())) {
event->handler(event->data);
- free(event);
+ free_event(event);
}
if(sigalrm) {
if(c->outgoing) {
free(c->outgoing->name);
- freeaddrinfo(c->outgoing->ai);
+ if(c->outgoing->ai)
+ freeaddrinfo(c->outgoing->ai);
free(c->outgoing);
c->outgoing = NULL;
}