mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-31 22:25:35 -04:00
UCM: fix memory leak when executing cset commands
fix memory leak when executing cset commands. snd_ctl_elem's are allocated, but never free'ed Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
e4735ddebd
commit
516569bbba
1 changed files with 10 additions and 1 deletions
|
|
@ -173,7 +173,8 @@ static int execute_cset(snd_ctl_t *ctl, char *cset)
|
|||
pos = strrchr(cset, ' ');
|
||||
if (pos == NULL) {
|
||||
uc_error("undefined value for cset >%s<", cset);
|
||||
return -EINVAL;
|
||||
err = -EINVAL;
|
||||
goto __fail;
|
||||
}
|
||||
*pos = '\0';
|
||||
err = snd_ctl_ascii_elem_id_parse(id, cset);
|
||||
|
|
@ -196,6 +197,14 @@ static int execute_cset(snd_ctl_t *ctl, char *cset)
|
|||
err = 0;
|
||||
__fail:
|
||||
*pos = ' ';
|
||||
|
||||
if (id != NULL)
|
||||
free(id);
|
||||
if (value != NULL)
|
||||
free(value);
|
||||
if (info != NULL)
|
||||
free(info);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue