ucm: fix error path in execute_cfgsave()

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2021-06-02 19:51:13 +02:00
parent cf3846d460
commit 200d18cda7

View file

@ -605,8 +605,10 @@ static int execute_cfgsave(snd_use_case_mgr_t *uc_mgr, const char *filename)
uc_error("unable to open file '%s': %s", file, snd_strerror(err));
goto _err;
}
if (!config || snd_config_is_empty(config))
if (!config || snd_config_is_empty(config)) {
snd_output_close(out);
goto _err;
}
if (with_root) {
snd_output_printf(out, "%s ", root);
err = _snd_config_save_node_value(config, out, 0);