From: Uwe Hermann Date: Tue, 15 May 2018 22:13:07 +0000 (+0200) Subject: instance.c: Fix a memory leak reported by scan-build. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=25d3576134e7b57ca169e8e4ebd4e4ce5dcf62dd;p=libsigrokdecode.git instance.c: Fix a memory leak reported by scan-build. instance.c:280:10: warning: Potential leak of memory pointed to by 'new_channelmap' pdch = g_slist_nth(di->decoder->channels, i)->data; ^~~~~~~~~~~ --- diff --git a/instance.c b/instance.c index f8cd2c6..a94118f 100644 --- a/instance.c +++ b/instance.c @@ -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; }