mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
ucm: execute_sysw - fix possible use-after-free
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
d28e8cb294
commit
e29413a220
1 changed files with 3 additions and 2 deletions
|
|
@ -572,16 +572,17 @@ static int execute_sysw(const char *sysw)
|
|||
wlen = write(fd, value, len);
|
||||
myerrno = errno;
|
||||
close(fd);
|
||||
free(s);
|
||||
|
||||
if (ignore_error)
|
||||
return 0;
|
||||
goto __end;
|
||||
|
||||
if (wlen != (ssize_t)len) {
|
||||
uc_error("unable to write '%s' to '%s': %s", value, path, strerror(myerrno));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
__end:
|
||||
free(s);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue