[or-cvs] Fix a leak when launching listeners.

Nick Mathewson nickm at seul.org
Fri Sep 30 21:28:03 UTC 2005


Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv7076/src/or

Modified Files:
	connection.c 
Log Message:
Fix a leak when launching listeners.

Index: connection.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/connection.c,v
retrieving revision 1.401
retrieving revision 1.402
diff -u -d -r1.401 -r1.402
--- connection.c	30 Sep 2005 01:09:52 -0000	1.401
+++ connection.c	30 Sep 2005 21:28:00 -0000	1.402
@@ -858,12 +858,14 @@
     line = NULL;
     SMARTLIST_FOREACH(launch, config_line_t *, wanted,
       {
-        char *addr;
+        char *addr=NULL;
         uint16_t port;
         if (! parse_addr_port(wanted->value, &addr, NULL, &port)) {
+          int addr_matches = !strcasecmp(addr, conn->address);
+          tor_free(addr);
           if (! port)
             port = port_option;
-          if (port == conn->port && !strcasecmp(addr, conn->address)) {
+          if (port == conn->port && addr_matches) {
             line = wanted;
             break;
           }



More information about the tor-commits mailing list