diff options
author | pjd <pjd@FreeBSD.org> | 2014-09-03 14:44:23 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2014-09-03 14:44:23 +0000 |
commit | 4509927d18b0250ebe70671f546bd8cbc99b29f1 (patch) | |
tree | 613408b5aef381c4502b9e185ae6918b6f801569 /lib | |
parent | 23ddd9899301c962e97fb6cb3465f9f67bbcb2f4 (diff) | |
download | FreeBSD-src-4509927d18b0250ebe70671f546bd8cbc99b29f1.zip FreeBSD-src-4509927d18b0250ebe70671f546bd8cbc99b29f1.tar.gz |
Fix descriptors leak in case of nvlist_xunpack() failure.
Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libnv/nvlist.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libnv/nvlist.c b/lib/libnv/nvlist.c index 929ba48..4cb089a 100644 --- a/lib/libnv/nvlist.c +++ b/lib/libnv/nvlist.c @@ -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: |