Skip to content

Commit

Permalink
[core] Fix memory leak when can't buffer a HS packet (#2757).
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaozhihong authored Aug 8, 2023
1 parent 9f41437 commit 256244f
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 256244f

Please sign in to comment.