From owner-svn-src-all@FreeBSD.ORG Sun Nov 30 23:38:44 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CF791065670; Sun, 30 Nov 2008 23:38:44 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C5538FC13; Sun, 30 Nov 2008 23:38:44 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAUNciwM005547; Sun, 30 Nov 2008 23:38:44 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAUNci3a005546; Sun, 30 Nov 2008 23:38:44 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200811302338.mAUNci3a005546@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 30 Nov 2008 23:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185495 - head/sbin/geom/class/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2008 23:38:44 -0000 Author: marcel Date: Sun Nov 30 23:38:44 2008 New Revision: 185495 URL: http://svn.freebsd.org/changeset/base/185495 Log: Call gctl_free() after we processed the error string. It's being freed as part of the request. 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 Sun Nov 30 22:58:27 2008 (r185494) +++ head/sbin/geom/class/part/geom_part.c Sun Nov 30 23:38:44 2008 (r185495) @@ -512,23 +512,29 @@ gpart_issue(struct gctl_req *req, unsign char buf[4096]; char *errmsg; const char *errstr; - int error; + int error, status; bzero(buf, sizeof(buf)); gctl_rw_param(req, "output", sizeof(buf), buf); errstr = gctl_issue(req); - gctl_free(req); if (errstr == NULL || errstr[0] == '\0') { if (buf[0] != '\0') printf("%s", buf); - exit(EXIT_SUCCESS); + status = EXIT_SUCCESS; + goto done; } error = strtol(errstr, &errmsg, 0); while (errmsg[0] == ' ') errmsg++; if (errmsg[0] != '\0') - errc(EXIT_FAILURE, error, "%s", errmsg); + warnc(error, "%s", errmsg); else - errc(EXIT_FAILURE, error, NULL); + warnc(error, NULL); + + status = EXIT_FAILURE; + + done: + gctl_free(req); + exit(status); }