From dc4a0aa2fa1bc3767785b552159ab0ebe5baa72e Mon Sep 17 00:00:00 2001 From: Mitch Hayenga Date: Tue, 8 Jan 2013 08:54:06 -0500 Subject: [PATCH] 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. --- src/mem/simple_mem.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.30.2