From: Mitch Hayenga Date: Tue, 8 Jan 2013 13:54:06 +0000 (-0500) Subject: mem: Fix use-after-free bug X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dc4a0aa2fa1bc3767785b552159ab0ebe5baa72e;p=gem5.git mem: Fix use-after-free bug Running with valgrind I noticed a use after free originating from simple_mem.cc. It looks like this is a known issue and this additional call site was missed in an earlier patch. --- diff --git a/src/mem/simple_mem.cc b/src/mem/simple_mem.cc index d3a53a26f..7dd0fd101 100644 --- a/src/mem/simple_mem.cc +++ b/src/mem/simple_mem.cc @@ -154,7 +154,7 @@ SimpleMemory::recvTimingReq(PacketPtr pkt) assert(pkt->isResponse()); port.schedTimingResp(pkt, curTick() + latency); } else { - delete pkt; + pendingDelete.push_back(pkt); } return true;