From owner-svn-src-head@freebsd.org Mon Mar 13 17:45:01 2017 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 83C7DD0A143; Mon, 13 Mar 2017 17:45:01 +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 509191C2F; Mon, 13 Mar 2017 17:45:01 +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 v2DHj0F9067128; Mon, 13 Mar 2017 17:45:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2DHj0VX067127; Mon, 13 Mar 2017 17:45:00 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703131745.v2DHj0VX067127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 13 Mar 2017 17:45:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315203 - head/sbin/dhclient 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.23 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: Mon, 13 Mar 2017 17:45:01 -0000 Author: ngie Date: Mon Mar 13 17:45:00 2017 New Revision: 315203 URL: https://svnweb.freebsd.org/changeset/base/315203 Log: sbin/dhclient: fix `vendor` storage leak in parse_option_decl(..) This ensures the storage isn't leaked when non-NULL and the function returns early, prior to the `free(vendor)` later on in the function. MFC after: 1 week Reported by: Coverity CID: 1007111-1007113 Reviewed by: cem Sponsored by: Dell EMC Isilon Differential Revision: D9993 Modified: head/sbin/dhclient/clparse.c Modified: head/sbin/dhclient/clparse.c ============================================================================== --- head/sbin/dhclient/clparse.c Mon Mar 13 17:35:55 2017 (r315202) +++ head/sbin/dhclient/clparse.c Mon Mar 13 17:45:00 2017 (r315203) @@ -714,6 +714,7 @@ parse_option_decl(FILE *cfile, struct op parse_warn("expecting identifier after '.'"); if (token != SEMI) skip_to_semi(cfile); + free(vendor); return (NULL); } @@ -726,6 +727,7 @@ parse_option_decl(FILE *cfile, struct op if (!universe) { parse_warn("no vendor named %s.", vendor); skip_to_semi(cfile); + free(vendor); return (NULL); } } else { @@ -747,6 +749,7 @@ parse_option_decl(FILE *cfile, struct op parse_warn("no option named %s for vendor %s", val, vendor); skip_to_semi(cfile); + free(vendor); return (NULL); }