Make sure connection->name is never NULL.
[tinc] / src / connection.c
index c4c9fd4..53c0fd0 100644 (file)
@@ -1,6 +1,6 @@
 /*
     connection.c -- connection list management
-    Copyright (C) 2000-2006 Guus Sliepen <guus@tinc-vpn.org>,
+    Copyright (C) 2000-2007 Guus Sliepen <guus@tinc-vpn.org>,
                   2000-2005 Ivo Timmermans
 
     This program is free software; you can redistribute it and/or modify
@@ -78,6 +78,9 @@ void free_connection(connection_t *c)
 {
        cp();
 
+       if(c->name)
+               free(c->name);
+
        if(c->hostname)
                free(c->hostname);