mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
core: Fix resource leak in core-util
https://scan7.coverity.com:8443/reports.htm#v10205/p10016/fileInstanceId=8477&defectInstanceId=3693&mergedDefectId=591269 Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
This commit is contained in:
parent
c2e9f1fdec
commit
ff9e9e05df
1 changed files with 6 additions and 2 deletions
|
|
@ -326,16 +326,20 @@ again:
|
|||
goto fail;
|
||||
}
|
||||
|
||||
if (!update_perms)
|
||||
if (!update_perms) {
|
||||
pa_assert_se(pa_close(fd) >= 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef HAVE_FCHOWN
|
||||
if (uid == (uid_t) -1)
|
||||
uid = getuid();
|
||||
if (gid == (gid_t) -1)
|
||||
gid = getgid();
|
||||
if (fchown(fd, uid, gid) < 0)
|
||||
if (fchown(fd, uid, gid) < 0) {
|
||||
pa_assert_se(pa_close(fd) >= 0);
|
||||
goto fail;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FCHMOD
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue