mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-21 01:40:09 -05:00
ucm: fix few memory-leaks in the error paths
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
378c6a9215
commit
fc86eafa08
2 changed files with 6 additions and 6 deletions
|
|
@ -1481,8 +1481,8 @@ const char *parse_open_variables(snd_use_case_mgr_t *uc_mgr, const char *name)
|
||||||
goto skip;
|
goto skip;
|
||||||
}
|
}
|
||||||
|
|
||||||
snd_config_delete(cfg);
|
|
||||||
skip:
|
skip:
|
||||||
|
snd_config_delete(cfg);
|
||||||
return end + 3;
|
return end + 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -415,15 +415,15 @@ static int evaluate_macro1(snd_use_case_mgr_t *uc_mgr,
|
||||||
n = snd_config_iterator_entry(i);
|
n = snd_config_iterator_entry(i);
|
||||||
err = snd_config_get_id(n, &id);
|
err = snd_config_get_id(n, &id);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
goto __err_path;
|
||||||
err = snd_config_get_ascii(n, &var);
|
err = snd_config_get_ascii(n, &var);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
goto __err_path;
|
||||||
snprintf(name, sizeof(name), "__%s", id);
|
snprintf(name, sizeof(name), "__%s", id);
|
||||||
err = uc_mgr_set_variable(uc_mgr, name, var);
|
err = uc_mgr_set_variable(uc_mgr, name, var);
|
||||||
free(var);
|
free(var);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
goto __err_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* merge + substitute variables */
|
/* merge + substitute variables */
|
||||||
|
|
@ -443,11 +443,11 @@ static int evaluate_macro1(snd_use_case_mgr_t *uc_mgr,
|
||||||
n = snd_config_iterator_entry(i);
|
n = snd_config_iterator_entry(i);
|
||||||
err = snd_config_get_id(n, &id);
|
err = snd_config_get_id(n, &id);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
goto __err_path;
|
||||||
snprintf(name, sizeof(name), "__%s", id);
|
snprintf(name, sizeof(name), "__%s", id);
|
||||||
err = uc_mgr_delete_variable(uc_mgr, name);
|
err = uc_mgr_delete_variable(uc_mgr, name);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
goto __err_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
__err_path:
|
__err_path:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue