From owner-svn-src-head@freebsd.org Wed Apr 5 18:31:27 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 94171D30FB7; Wed, 5 Apr 2017 18:31:27 +0000 (UTC) (envelope-from asomers@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 6358F7AE; Wed, 5 Apr 2017 18:31:27 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v35IVQTc005285; Wed, 5 Apr 2017 18:31:26 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v35IVQos005284; Wed, 5 Apr 2017 18:31:26 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201704051831.v35IVQos005284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 5 Apr 2017 18:31:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316535 - head/sbin/geom/class/part 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: Wed, 05 Apr 2017 18:31:27 -0000 Author: asomers Date: Wed Apr 5 18:31:26 2017 New Revision: 316535 URL: https://svnweb.freebsd.org/changeset/base/316535 Log: Fix memory leak in "gpart bootcode" Also, annotate that gpart_issue never returns Reported by: Coverity CID: 1007105 MFC after: 3 weeks Sponsored by: Spectra Logic Corp Modified: head/sbin/geom/class/part/geom_part.c Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Wed Apr 5 17:56:21 2017 (r316534) +++ head/sbin/geom/class/part/geom_part.c Wed Apr 5 18:31:26 2017 (r316535) @@ -81,7 +81,7 @@ static int gpart_autofill(struct gctl_re static int gpart_autofill_resize(struct gctl_req *); static void gpart_bootcode(struct gctl_req *, unsigned int); static void *gpart_bootfile_read(const char *, ssize_t *); -static void gpart_issue(struct gctl_req *, unsigned int); +static _Noreturn void gpart_issue(struct gctl_req *, unsigned int); static void gpart_show(struct gctl_req *, unsigned int); static void gpart_show_geom(struct ggeom *, const char *, int); static int gpart_show_hasopt(struct gctl_req *, const char *, const char *); @@ -1270,6 +1270,7 @@ gpart_bootcode(struct gctl_req *req, uns gpart_issue(req, fl); geom_deletetree(&mesh); + free(partcode); } static void @@ -1290,7 +1291,7 @@ gpart_print_error(const char *errstr) warnx("%s", errmsg); } -static void +static _Noreturn void gpart_issue(struct gctl_req *req, unsigned int fl __unused) { char buf[4096];