]> sigrok.org Git - pulseview.git/commitdiff
DecoderStack: Fix memory leak
authorSoeren Apel <redacted>
Wed, 22 Mar 2017 22:26:21 +0000 (23:26 +0100)
committerSoeren Apel <redacted>
Wed, 22 Mar 2017 22:26:21 +0000 (23:26 +0100)
pv/data/decoderstack.cpp

index f393a1bb84dc06b7034235a88cb110b5879c96a9..3499baf22205cb1d0338f8d77d8645ab7d437cbd 100644 (file)
@@ -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<mutex> lock(output_mutex_);