From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 14:44:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61DB6C11; Wed, 3 Sep 2014 14:44:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DDCB1332; Wed, 3 Sep 2014 14:44:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s83EiODc070848; Wed, 3 Sep 2014 14:44:24 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s83EiOvS070847; Wed, 3 Sep 2014 14:44:24 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201409031444.s83EiOvS070847@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Wed, 3 Sep 2014 14:44:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271026 - head/lib/libnv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 14:44:24 -0000 Author: pjd Date: Wed Sep 3 14:44:23 2014 New Revision: 271026 URL: http://svnweb.freebsd.org/changeset/base/271026 Log: Fix descriptors leak in case of nvlist_xunpack() failure. Submitted by: Mariusz Zaborski Modified: head/lib/libnv/nvlist.c Modified: head/lib/libnv/nvlist.c ============================================================================== --- head/lib/libnv/nvlist.c Wed Sep 3 14:16:50 2014 (r271025) +++ head/lib/libnv/nvlist.c Wed Sep 3 14:44:23 2014 (r271026) @@ -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: