Date: Sun, 30 Nov 2008 23:38:44 +0000 (UTC) From: Marcel Moolenaar <marcel@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r185495 - head/sbin/geom/class/part Message-ID: <200811302338.mAUNci3a005546@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811302338.mAUNci3a005546>