[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] Avoid double-free on tor-resolve failure
Update of /home/or/cvsroot/tor/src/or
In directory moria.mit.edu:/tmp/cvs-serv6387/src/or
Modified Files:
connection_edge.c
Log Message:
Avoid double-free on tor-resolve failure
Index: connection_edge.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/connection_edge.c,v
retrieving revision 1.274
retrieving revision 1.275
diff -u -d -r1.274 -r1.275
--- connection_edge.c 5 Feb 2005 21:03:24 -0000 1.274
+++ connection_edge.c 5 Feb 2005 23:55:21 -0000 1.275
@@ -906,8 +906,10 @@
/* 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 */