aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-10-18 07:09:09 +0000
committerRoger Dingledine <arma@torproject.org>2003-10-18 07:09:09 +0000
commit9d3f2b232b632a4519bf4f0c49ccd1bab8407978 (patch)
treeaa9bfc32837b005c572b640e836debf2940ba3f1
parent61e180ceb1bf71f00903c671a82c9d04ae80a7cc (diff)
downloadtor-9d3f2b232b632a4519bf4f0c49ccd1bab8407978.tar
tor-9d3f2b232b632a4519bf4f0c49ccd1bab8407978.tar.gz
another minor memory leak
make dnsconn->address reflect what it's currently resolving svn:r624
-rw-r--r--src/or/dns.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/or/dns.c b/src/or/dns.c
index f915ea6c2..7c0566c80 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -165,6 +165,7 @@ static int assign_to_dnsworker(connection_t *exitconn) {
return -1;
}
+ free(dnsconn->address);
dnsconn->address = tor_strdup(exitconn->address);
dnsconn->state = DNSWORKER_STATE_BUSY;
num_dnsworkers_busy++;
@@ -312,7 +313,7 @@ int connection_dns_process_inbuf(connection_t *conn) {
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 @@ static int spawn_dnsworker(void) {
/* 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.");