[or-cvs] another minor memory leak

Roger Dingledine arma at seul.org
Sat Oct 18 07:09:11 UTC 2003


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/dev/src/or

Modified Files:
	dns.c 
Log Message:
another minor memory leak
make dnsconn->address reflect what it's currently resolving


Index: dns.c
===================================================================
RCS file: /home/or/cvsroot/src/or/dns.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- dns.c	15 Oct 2003 18:28:32 -0000	1.33
+++ dns.c	18 Oct 2003 07:09:09 -0000	1.34
@@ -165,6 +165,7 @@
     return -1;
   }
 
+  free(dnsconn->address);
   dnsconn->address = tor_strdup(exitconn->address);
   dnsconn->state = DNSWORKER_STATE_BUSY;
   num_dnsworkers_busy++;
@@ -312,7 +313,7 @@
   dns_found_answer(conn->address, answer);
 
   free(conn->address);
-  conn->address = NULL;
+  conn->address = strdup("<idle>");
   conn->state = DNSWORKER_STATE_IDLE;
   num_dnsworkers_busy--;
 
@@ -381,7 +382,7 @@
 
   /* set up conn so it's got all the data we need to remember */
   conn->s = fd[0];
-  conn->address = tor_strdup("localhost");
+  conn->address = tor_strdup("<unused>");
 
   if(connection_add(conn) < 0) { /* no space, forget it */
     log_fn(LOG_WARN,"connection_add failed. Giving up.");



More information about the tor-commits mailing list