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
@ -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