sysetmc: fix the leak in TlmToGem5Bridge
In the previous refactor, I made a mistake causing memory leak. This change fix the mistake. Previous refactor: https://gem5-review.googlesource.com/c/public/gem5/+/63771 Change-Id: I244a990e00507a6b065af38c61f061bc5d72d90e Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64391 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -430,7 +430,7 @@ TlmToGem5Bridge<BITWIDTH>::get_direct_mem_ptr(tlm::tlm_generic_payload &trans,
|
||||
// clean up
|
||||
delete senderState;
|
||||
|
||||
if (!pkt_created)
|
||||
if (pkt_created)
|
||||
destroyPacket(pkt);
|
||||
|
||||
trans.set_response_status(tlm::TLM_OK_RESPONSE);
|
||||
|
||||
Reference in New Issue
Block a user