summaryrefslogtreecommitdiff
path: root/src/cpu
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2015-11-22 05:10:16 -0500
committerAndreas Hansson <andreas.hansson@arm.com>2015-11-22 05:10:16 -0500
commit949437d559bcb0d40f6fe4fa81984a2467b7b52f (patch)
treea1bb9cc8f4faf0e36f77dc3734cf40321e770a2b /src/cpu
parentd57a855e40e5d85024ce4a5dd31ad1e45897ee04 (diff)
downloadgem5-949437d559bcb0d40f6fe4fa81984a2467b7b52f.tar.xz
cpu: Fix memory leak in traffic generator
In cases where we discard the packet, make sure to also delete it and the associated request.
Diffstat (limited to 'src/cpu')
-rw-r--r--src/cpu/testers/traffic_gen/traffic_gen.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cpu/testers/traffic_gen/traffic_gen.cc b/src/cpu/testers/traffic_gen/traffic_gen.cc
index 984c9950d..f8eb38d31 100644
--- a/src/cpu/testers/traffic_gen/traffic_gen.cc
+++ b/src/cpu/testers/traffic_gen/traffic_gen.cc
@@ -198,6 +198,9 @@ TrafficGen::update()
} else {
DPRINTF(TrafficGen, "Suppressed packet %s 0x%x\n",
pkt->cmdString(), pkt->getAddr());
+ delete pkt->req;
+ delete pkt;
+ pkt = nullptr;
}
}