From 7e0cf704944cf622634ecec2290ddc39571719aa Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 26 Aug 2014 11:28:22 +0200 Subject: Fix memory leak in ZMQ input --- src/dabInputZmq.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/dabInputZmq.cpp b/src/dabInputZmq.cpp index 49ba0f6..7e79c73 100644 --- a/src/dabInputZmq.cpp +++ b/src/dabInputZmq.cpp @@ -274,6 +274,7 @@ int DabInputZmqBase::readFrame(void* buffer, int size) size_t over_max = m_frame_buffer.size() - m_config.prebuffering; while (over_max--) { + delete[] m_frame_buffer.front(); m_frame_buffer.pop_front(); } } @@ -292,11 +293,10 @@ int DabInputZmqBase::readFrame(void* buffer, int size) * TODO: also, with MPEG, the above doesn't hold, so we drop five * frames even though we could drop less. * */ - m_frame_buffer.pop_front(); - m_frame_buffer.pop_front(); - m_frame_buffer.pop_front(); - m_frame_buffer.pop_front(); - m_frame_buffer.pop_front(); + for (int frame_del_count = 0; frame_del_count < 5; frame_del_count++) { + delete[] m_frame_buffer.front(); + m_frame_buffer.pop_front(); + } } } -- cgit v1.2.3