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 30, 2023
1 parent 10e71a6 commit 001eae7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions srtcore/queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1783,7 +1783,11 @@ void srt::CRcvQueue::storePkt(int32_t id, CPacket* pkt)
{
// avoid storing too many packets, in case of malfunction or attack
if (i->second.size() > 16)
{
delete[] pkt->m_pcData;
delete pkt;
return;
}

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

0 comments on commit 001eae7

Please sign in to comment.