Update copyright notices.
[tinc] / src / net.c
index 81a0d89..31f1b0e 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -424,7 +424,7 @@ int main_loop(void)
 
                while((event = get_expired_event())) {
                        event->handler(event->data);
-                       free(event);
+                       free_event(event);
                }
 
                if(sigalrm) {
@@ -463,7 +463,8 @@ int main_loop(void)
                                
                                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;
                                }