]> sigrok.org Git - libsigrokdecode.git/blobdiff - instance.c
instance.c: Fix a memory leak reported by scan-build.
[libsigrokdecode.git] / instance.c
index e470bd14e70ab0a1f0085e1edb20cea3a112e956..a94118f2430de4991f70708522999fc49e02b53c 100644 (file)
@@ -280,6 +280,7 @@ SRD_API int srd_inst_channel_set_all(struct srd_decoder_inst *di,
                pdch = g_slist_nth(di->decoder->channels, i)->data;
                srd_err("Required channel '%s' (index %d) was not specified.",
                        pdch->id, i);
+               g_free(new_channelmap);
                return SRD_ERR;
        }
 
@@ -1266,6 +1267,8 @@ SRD_PRIV int srd_inst_decode(struct srd_decoder_inst *di,
                g_cond_wait(&di->handled_all_samples_cond, &di->data_mutex);
        g_mutex_unlock(&di->data_mutex);
 
+       if (di->want_wait_terminate)
+               return SRD_ERR_TERM_REQ;
        return SRD_OK;
 }