summaryrefslogtreecommitdiff
path: root/bouncer/client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'bouncer/client.cpp')
-rw-r--r--bouncer/client.cpp9
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;
+ }
+ });
}