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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user