x86: Fix memory leak in table walker
This patch fixes a memory leak in the table walker, by ensuring that the sender state is deleted again if the request packet cannot be successfully sent.
This commit is contained in:
parent
7db542c0dd
commit
f2b0b551cc
1 changed files with 12 additions and 2 deletions
|
@ -165,8 +165,18 @@ Walker::recvRetry()
|
|||
|
||||
bool Walker::sendTiming(WalkerState* sendingState, PacketPtr pkt)
|
||||
{
|
||||
pkt->pushSenderState(new WalkerSenderState(sendingState));
|
||||
return port.sendTimingReq(pkt);
|
||||
WalkerSenderState* walker_state = new WalkerSenderState(sendingState);
|
||||
pkt->pushSenderState(walker_state);
|
||||
if (port.sendTimingReq(pkt)) {
|
||||
return true;
|
||||
} else {
|
||||
// undo the adding of the sender state and delete it, as we
|
||||
// will do it again the next time we attempt to send it
|
||||
pkt->popSenderState();
|
||||
delete walker_state;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
BaseMasterPort &
|
||||
|
|
Loading…
Reference in a new issue