diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-02-05 23:55:21 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-02-05 23:55:21 +0000 |
commit | a64b03a4fd2b7b146f4d5f8985229c7bd56d8721 (patch) | |
tree | cf9ed68fe1c3a8d9a05d20c3c40d809089f8df1d /src | |
parent | bb32fa86d760bd4f18793e635c3cb7d5b932307b (diff) | |
download | tor-a64b03a4fd2b7b146f4d5f8985229c7bd56d8721.tar.gz tor-a64b03a4fd2b7b146f4d5f8985229c7bd56d8721.zip |
Avoid double-free on tor-resolve failure
svn:r3567
Diffstat (limited to 'src')
-rw-r--r-- | src/or/connection_edge.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index e67be3dfcf..75717c337b 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -906,8 +906,10 @@ int connection_exit_begin_resolve(cell_t *cell, circuit_t *circ) { /* send it off to the gethostbyname farm */ switch (dns_resolve(dummy_conn)) { - case 1: /* The result was cached; a resolved cell was sent. */ case -1: /* Impossible to resolve; a resolved cell was sent. */ + /* Connection freed; don't touch it. */ + return 0; + case 1: /* The result was cached; a resolved cell was sent. */ connection_free(dummy_conn); return 0; case 0: /* resolve added to pending list */ |