analog: avoid double free in '-O analog' shutdown path

Do void the 'def' and 'values' references for '-O analog' module options
in the shutdown path, to avoid double free calls.
This commit is contained in:
milan hauth 2020-07-28 17:01:03 +02:00 committed by Gerhard Sittig
parent 9dde746023
commit 588295b8b9
1 changed files with 8 additions and 2 deletions

View File

@ -195,8 +195,14 @@ static int cleanup(struct sr_output *o)
ctx = o->priv;
g_ptr_array_free(ctx->channellist, 1);
g_variant_unref(options[0].def);
g_slist_free_full(options[0].values, (GDestroyNotify)g_variant_unref);
if (options[0].def) {
g_variant_unref(options[0].def);
options[0].def = NULL;
}
if (options[0].values) {
g_slist_free_full(options[0].values, (GDestroyNotify)g_variant_unref);
options[0].values = NULL;
}
g_free(ctx->fdata);
g_free(ctx);
o->priv = NULL;