aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Somers <asomers@FreeBSD.org>2017-04-05 18:31:26 +0000
committerAlan Somers <asomers@FreeBSD.org>2017-04-05 18:31:26 +0000
commit4db3787dd968df27c92ed643f61ee2e0c9322f85 (patch)
tree2b9123b47cfe73c1989f9d9f24617f23dd0e5ee3
parent9c0e1d45c511d65609532dd5607de79535cebdff (diff)
downloadsrc-4db3787dd968df27c92ed643f61ee2e0c9322f85.tar.gz
src-4db3787dd968df27c92ed643f61ee2e0c9322f85.zip
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
Notes
Notes: svn path=/head/; revision=316535
-rw-r--r--sbin/geom/class/part/geom_part.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/geom/class/part/geom_part.c b/sbin/geom/class/part/geom_part.c
index 4f57f0089446..c6bd6d48765d 100644
--- a/sbin/geom/class/part/geom_part.c
+++ b/sbin/geom/class/part/geom_part.c
@@ -81,7 +81,7 @@ static int gpart_autofill(struct gctl_req *);
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, unsigned int fl)
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];