alsactl: fix possible memory leak for dump-cfg

Also remove extra snd_config_update_free_global() call for dump-state.
There's a global call in the main() function.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2021-03-10 18:12:09 +01:00
parent c3f2344b72
commit 7f5622c106

View file

@ -179,7 +179,6 @@ static int dump_state(const char *file)
return err;
err = dump_config_tree(top);
snd_config_delete(top);
snd_config_update_free_global();
return err;
}
@ -192,7 +191,9 @@ static int dump_configuration(void)
if (err < 0)
return err;
/* expand cards.* tree */
snd_config_search_definition(top, "cards", "dummy", &cfg2);
err = snd_config_search_definition(top, "cards", "_dummy_", &cfg2);
if (err >= 0)
snd_config_delete(cfg2);
err = dump_config_tree(top);
snd_config_unref(top);
return err;