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:
parent
d57a855e40
commit
949437d559
|
@ -198,6 +198,9 @@ TrafficGen::update()
|
||||||
} else {
|
} else {
|
||||||
DPRINTF(TrafficGen, "Suppressed packet %s 0x%x\n",
|
DPRINTF(TrafficGen, "Suppressed packet %s 0x%x\n",
|
||||||
pkt->cmdString(), pkt->getAddr());
|
pkt->cmdString(), pkt->getAddr());
|
||||||
|
delete pkt->req;
|
||||||
|
delete pkt;
|
||||||
|
pkt = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue