hantek-dso: Fix segfault when accessing already free()d memory.

This fix was guessed from other drivers' code.

This fixes bug #458.
This commit is contained in:
Philipp Marek 2017-11-21 14:50:18 +01:00 committed by Uwe Hermann
parent 95983cc3fe
commit be10b96d40
1 changed files with 1 additions and 0 deletions

View 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;