aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-08-26 11:28:22 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-08-26 11:28:22 +0200
commit7e0cf704944cf622634ecec2290ddc39571719aa (patch)
tree46ce5d2d76d57bfbd0524b9bbebfc3f025c6b1d5 /src
parent7a056ef2cb94fb2fa45d8ecaed9dd97e99749fde (diff)
downloaddabmux-7e0cf704944cf622634ecec2290ddc39571719aa.tar.gz
dabmux-7e0cf704944cf622634ecec2290ddc39571719aa.tar.bz2
dabmux-7e0cf704944cf622634ecec2290ddc39571719aa.zip
Fix memory leak in ZMQ input
Diffstat (limited to 'src')
-rw-r--r--src/dabInputZmq.cpp10
1 files changed, 5 insertions, 5 deletions
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();
+ }
}
}