mixer: close the file descriptor on error.

CID: 1365407
This commit is contained in:
Michaël Bouchaud (yoz) 2016-11-07 10:32:04 +01:00
parent 568a676073
commit be154b60c8
1 changed files with 5 additions and 1 deletions

View File

@ -890,7 +890,11 @@ _get_ppid(pid_t pid)
ERR("Can't open %s, maybee the process exited.", buf);
return -1;
}
if ((read(fd, buf, sizeof(buf))) < 4) return -1;
if ((read(fd, buf, sizeof(buf))) < 4)
{
close(fd);
return -1;
}
buf[sizeof(buf) - 1] = 0;
s = strrchr(buf, ')');
s += 3;