]> sigrok.org Git - libsigrok.git/commitdiff
hantek-dso: Fix segfault when accessing already free()d memory.
authorPhilipp Marek <redacted>
Tue, 21 Nov 2017 13:50:18 +0000 (14:50 +0100)
committerUwe Hermann <redacted>
Thu, 11 Jan 2018 01:21:30 +0000 (02:21 +0100)
This fix was guessed from other drivers' code.

This fixes bug #458.

src/hardware/hantek-dso/api.c

index 857ea0df7e9b9c57c8d59a79cbd5466e1328d4d4..d86eff611c64caf1974a5db682f9a9e533ad4b38 100644 (file)
@@ -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;