Skip to content

Commit

Permalink
Fix memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaozhihong committed Jun 29, 2023
1 parent 10e71a6 commit 2ddf398
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion srtcore/queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1782,8 +1782,11 @@ void srt::CRcvQueue::storePkt(int32_t id, CPacket* pkt)
else
{
// avoid storing too many packets, in case of malfunction or attack
if (i->second.size() > 16)
if (i->second.size() > 16) {
delete[] pkt->m_pcData;
delete pkt;
return;
}

i->second.push(pkt);
}
Expand Down

0 comments on commit 2ddf398

Please sign in to comment.