Fix descriptors leak in case of nvlist_xunpack() failure.

Submitted by:	Mariusz Zaborski <oshogbo@FreeBSD.org>
This commit is contained in:
Pawel Jakub Dawidek 2014-09-03 14:44:23 +00:00
parent d1b809ff9f
commit c7bf0f5006
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=271026

View File

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