Fix descriptors leak in case of nvlist_xunpack() failure.
Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org>
This commit is contained in:
parent
d1b809ff9f
commit
c7bf0f5006
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=271026
@ -760,8 +760,11 @@ nvlist_recv(int sock)
|
||||
}
|
||||
|
||||
nvl = nvlist_xunpack(buf, size, fds, nfds);
|
||||
if (nvl == NULL)
|
||||
if (nvl == NULL) {
|
||||
for (i = 0; i < nfds; i++)
|
||||
close(fds[i]);
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = nvl;
|
||||
out:
|
||||
|
Loading…
Reference in New Issue
Block a user