From: Soeren Apel Date: Wed, 22 Mar 2017 22:26:21 +0000 (+0100) Subject: DecoderStack: Fix memory leak X-Git-Tag: pulseview-0.4.0~130 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=1138e9359d88d51ed610f2e0bd007c021b9e59bb;p=pulseview.git DecoderStack: Fix memory leak --- diff --git a/pv/data/decoderstack.cpp b/pv/data/decoderstack.cpp index f393a1bb..3499baf2 100644 --- a/pv/data/decoderstack.cpp +++ b/pv/data/decoderstack.cpp @@ -317,8 +317,10 @@ void DecoderStack::decode_data( if (srd_session_send(session, i, chunk_end, chunk, (chunk_end - i) * unit_size, unit_size) != SRD_OK) { error_message_ = tr("Decoder reported an error"); + delete[] chunk; break; } + delete[] chunk; { lock_guard lock(output_mutex_);