]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix memory leaks in ConnStateData pinning
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 29 Mar 2013 05:59:17 +0000 (23:59 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 29 Mar 2013 05:59:17 +0000 (23:59 -0600)
ConnStateData does not cleanup any of the pinning child structure fields.
This results in a leak of pinned host and peer details.

Run the full un-pin cleanup operation from ConnStateData::swanSong in
order to clean up all the pinning state instead of just the release the
Comm::Connection.

src/client_side.cc

index eb5f5e0b7c2d511be408b5b145513dc1b80372a5..d0b88f8e9e3c64219e630ce0a1317375bf7cc249 100644 (file)
@@ -793,9 +793,7 @@ ConnStateData::swanSong()
     }
 #endif
 
-    if (Comm::IsConnOpen(pinning.serverConnection))
-        pinning.serverConnection->close();
-    pinning.serverConnection = NULL;
+    unpinConnection();
 
     if (Comm::IsConnOpen(clientConnection))
         clientConnection->close();