From e8dec5db83053b6fc05b6d7a00b57f4213445895 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 25 Apr 2021 19:16:50 +0200 Subject: [PATCH] APT demod: fixed some possible memory leaks --- plugins/channelrx/demodapt/aptdemodsink.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/channelrx/demodapt/aptdemodsink.cpp b/plugins/channelrx/demodapt/aptdemodsink.cpp index 5a53eef72..7e341d6c4 100644 --- a/plugins/channelrx/demodapt/aptdemodsink.cpp +++ b/plugins/channelrx/demodapt/aptdemodsink.cpp @@ -65,7 +65,7 @@ void APTDemodSink::resetDecoder() APTDemodSink::~APTDemodSink() { - delete m_samples; + delete[] m_samples; } // callback from APT library to get audio samples @@ -122,10 +122,10 @@ void APTDemodSink::feed(const SampleVector::const_iterator& begin, const SampleV // 2 lines per second if (m_sampleCount >= APTDEMOD_AUDIO_SAMPLE_RATE) { - float *pixels = new float[APT_PROW_WIDTH]; - apt_getpixelrow(pixels, m_row, &m_zenith, m_row == 0, getsamples, this); - - if (getImageWorkerMessageQueue()) { + if (getImageWorkerMessageQueue()) + { + float *pixels = new float[APT_PROW_WIDTH]; + apt_getpixelrow(pixels, m_row, &m_zenith, m_row == 0, getsamples, this); getImageWorkerMessageQueue()->push(APTDemod::MsgPixels::create(pixels, m_zenith)); }