mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-03-07 04:33:44 -05:00
conf: fix possible memory leak in config_file_open() - error path
Fixes: a6238053 ("conf: merge card specific contents per file (whole) after parsing")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
a6238053c4
commit
2f59398c83
1 changed files with 4 additions and 1 deletions
|
|
@ -4130,8 +4130,11 @@ static int config_file_open(snd_config_t *root, const char *filename, int merge)
|
||||||
err = snd_config_top(&top);
|
err = snd_config_top(&top);
|
||||||
if (err >= 0) {
|
if (err >= 0) {
|
||||||
err = snd_config_load(top, in);
|
err = snd_config_load(top, in);
|
||||||
if (err >= 0)
|
if (err >= 0) {
|
||||||
err = snd_config_merge(root, top, 1);
|
err = snd_config_merge(root, top, 1);
|
||||||
|
if (err < 0)
|
||||||
|
snd_config_delete(top);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
snd_input_close(in);
|
snd_input_close(in);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue