]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix memory leaks in ConnStateData pinning
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 28 Mar 2013 03:16:05 +0000 (21:16 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 28 Mar 2013 03:16:05 +0000 (21:16 -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 626018be25837a2f638cb54e3d9649859e9e652b..25ed433d670bc9bcfd6f76f75e94e32220933714 100644 (file)
@@ -809,9 +809,7 @@ ConnStateData::swanSong()
     }
 #endif
 
-    if (Comm::IsConnOpen(pinning.serverConnection))
-        pinning.serverConnection->close();
-    pinning.serverConnection = NULL;
+    unpinConnection();
 
     if (Comm::IsConnOpen(clientConnection))
         clientConnection->close();