From: Philipp Marek Date: Tue, 21 Nov 2017 13:50:18 +0000 (+0100) Subject: hantek-dso: Fix segfault when accessing already free()d memory. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=be10b96d40baddbf8b1bf341c2da115a34e716a5;p=libsigrok.git hantek-dso: Fix segfault when accessing already free()d memory. This fix was guessed from other drivers' code. This fixes bug #458. --- diff --git a/src/hardware/hantek-dso/api.c b/src/hardware/hantek-dso/api.c index 857ea0df..d86eff61 100644 --- a/src/hardware/hantek-dso/api.c +++ b/src/hardware/hantek-dso/api.c @@ -237,6 +237,7 @@ static int configure_channels(const struct sr_dev_inst *sdi) devc = sdi->priv; g_slist_free(devc->enabled_channels); + devc->enabled_channels = NULL; devc->ch_enabled[0] = devc->ch_enabled[1] = FALSE; for (l = sdi->channels, p = 0; l; l = l->next, p++) { ch = l->data;