]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Christos Tsantilas <chtsanti@users.sourceforge.net>
authorrousskov <>
Tue, 16 Oct 2007 20:38:18 +0000 (20:38 +0000)
committerrousskov <>
Tue, 16 Oct 2007 20:38:18 +0000 (20:38 +0000)
Bug #2098 fix: SegFault in tunnelConnectTimeout error page generation.

The tunnelConnectTimeout function used the tunnelState object (and propably
the tunnelState->request object) after they were freed by the comm_close call.
The fix moves the comm_close call to the end of tunnelConnectTimeout.

src/tunnel.cc

index dea3b204a6eae67a3ae8052846b57a639da7b5cf..da4fdcb6d82d47cc51937b13e20b4193b1e04d4e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tunnel.cc,v 1.174 2007/09/25 13:23:13 hno Exp $
+ * $Id: tunnel.cc,v 1.175 2007/10/16 14:38:18 rousskov Exp $
  *
  * DEBUG: section 26    Secure Sockets Layer Proxy
  * AUTHOR: Duane Wessels
@@ -475,7 +475,6 @@ tunnelConnectTimeout(int fd, void *data)
         hierarchyNote(&tunnelState->request->hier, tunnelState->servers->code,
                       tunnelState->host);
 
-    comm_close(fd);
 
     err = errorCon(ERR_CONNECT_FAIL, HTTP_SERVICE_UNAVAILABLE, request);
 
@@ -490,6 +489,7 @@ tunnelConnectTimeout(int fd, void *data)
     err->callback_data = tunnelState;
 
     errorSend(tunnelState->client.fd(), err);
+    comm_close(fd);
 }
 
 static void