diff options
author | Treeki <treeki@gmail.com> | 2014-02-12 13:26:46 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2014-02-12 13:26:46 +0100 |
commit | ab96a4a6708a58109154fb3e0959c1b03c3ce302 (patch) | |
tree | 290da57bd12e4f996a4f7898c97e5a18e87aa904 /bouncer | |
parent | 44f0ddfd1d583dadf277db67104dde4facbc53d4 (diff) | |
download | bounce4-ab96a4a6708a58109154fb3e0959c1b03c3ce302.tar.gz bounce4-ab96a4a6708a58109154fb3e0959c1b03c3ce302.zip |
bouncer: fix massive memory leak where cached packets were not freed
Diffstat (limited to 'bouncer')
-rw-r--r-- | bouncer/client.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bouncer/client.cpp b/bouncer/client.cpp index d04d0be..79e97a2 100644 --- a/bouncer/client.cpp +++ b/bouncer/client.cpp @@ -124,8 +124,13 @@ void Client::generateSessionKey() { void Client::clearCachedPackets(int maxID) { packetCache.remove_if([maxID](Packet *&pkt) { - return (pkt->id <= maxID); - }); + if (pkt->id <= maxID) { + delete pkt; + return true; + } else { + return false; + } + }); } |