From owner-svn-src-head@freebsd.org Sun May 22 02:53:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD237B3B0EF; Sun, 22 May 2016 02:53:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 7AE971A0D; Sun, 22 May 2016 02:53:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4M2rBHZ095911; Sun, 22 May 2016 02:53:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4M2rBIS095910; Sun, 22 May 2016 02:53:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605220253.u4M2rBIS095910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 22 May 2016 02:53:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300388 - head/lib/libc/rpc 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.22 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: Sun, 22 May 2016 02:53:12 -0000 Author: ngie Date: Sun May 22 02:53:11 2016 New Revision: 300388 URL: https://svnweb.freebsd.org/changeset/base/300388 Log: Call endnetconfig on nc_handle sooner to avoid leaking nc_handle if tmpnconf was NULL This would theoretically happen if the netconfig protocol family and protocol semantics were never matched. MFC after: 2 weeks Reported by: Coverity CID: 978179 Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/rpc/rpcb_clnt.c Modified: head/lib/libc/rpc/rpcb_clnt.c ============================================================================== --- head/lib/libc/rpc/rpcb_clnt.c Sun May 22 02:24:38 2016 (r300387) +++ head/lib/libc/rpc/rpcb_clnt.c Sun May 22 02:53:11 2016 (r300388) @@ -499,6 +499,7 @@ try_nconf: hostname = IN6_LOCALHOST_STRING; } } + endnetconfig(nc_handle); if (tmpnconf == NULL) { rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; mutex_unlock(&loopnconf_lock); @@ -506,7 +507,6 @@ try_nconf: } loopnconf = getnetconfigent(tmpnconf->nc_netid); /* loopnconf is never freed */ - endnetconfig(nc_handle); } mutex_unlock(&loopnconf_lock); client = getclnthandle(hostname, loopnconf, NULL);