]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Avoid double-free on tor-resolve failure
authorNick Mathewson <nickm@torproject.org>
Sat, 5 Feb 2005 23:55:21 +0000 (23:55 +0000)
committerNick Mathewson <nickm@torproject.org>
Sat, 5 Feb 2005 23:55:21 +0000 (23:55 +0000)
svn:r3567

src/or/connection_edge.c

index e67be3dfcfcbcd7a0a04248995246d8135637216..75717c337b632bf3b8231ea638e11d23fb2b02db 100644 (file)
@@ -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 */