cpu: Fix memory leak in traffic generator

In cases where we discard the packet, make sure to also delete it and
the associated request.
This commit is contained in:
Andreas Hansson 2015-11-22 05:10:16 -05:00
parent d57a855e40
commit 949437d559

View file

@ -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;
}
}