From ba29095d10d280dd26d607f2a92bc567e6ae497b Mon Sep 17 00:00:00 2001 From: chenhaibo Date: Wed, 30 Sep 2020 11:16:37 +0800 Subject: [PATCH] RTC: fix memory leak bug --- trunk/src/app/srs_app_rtc_queue.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/trunk/src/app/srs_app_rtc_queue.cpp b/trunk/src/app/srs_app_rtc_queue.cpp index 827f835a2..efa3a6b75 100644 --- a/trunk/src/app/srs_app_rtc_queue.cpp +++ b/trunk/src/app/srs_app_rtc_queue.cpp @@ -47,6 +47,10 @@ SrsRtpRingBuffer::SrsRtpRingBuffer(int capacity) SrsRtpRingBuffer::~SrsRtpRingBuffer() { + for (int i = 0; i < capacity_; ++i) { + SrsRtpPacket2* pkt = queue_[i]; + srs_freep(pkt); + } srs_freepa(queue_); }