diff options
author | phk <phk@FreeBSD.org> | 2003-05-01 21:07:08 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-05-01 21:07:08 +0000 |
commit | ea4d816aa1ef041f9d21361a8315a21cf19fb8d5 (patch) | |
tree | 58dc5c9754c98494d877be06944eb0468f285235 /sys/geom/geom_sunlabel.c | |
parent | 06edd5856967ea7083ea64d5163e1bafe335cbe0 (diff) | |
download | FreeBSD-src-ea4d816aa1ef041f9d21361a8315a21cf19fb8d5.zip FreeBSD-src-ea4d816aa1ef041f9d21361a8315a21cf19fb8d5.tar.gz |
Plug some memory-leaks.
Diffstat (limited to 'sys/geom/geom_sunlabel.c')
-rw-r--r-- | sys/geom/geom_sunlabel.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/geom/geom_sunlabel.c b/sys/geom/geom_sunlabel.c index a8891af..49d6d9c 100644 --- a/sys/geom/geom_sunlabel.c +++ b/sys/geom/geom_sunlabel.c @@ -191,8 +191,10 @@ g_sunlabel_config(struct gctl_req *req, struct g_geom *gp, const char *verb) h0h0.error = -1; /* XXX: Does this reference register with our selfdestruct code ? */ error = g_access_rel(cp, 1, 1, 1); - if (error) + if (error) { + g_free(label); return (error); + } g_topology_unlock(); g_waitfor_event(g_sunlabel_callconfig, &h0h0, M_WAITOK, gp, NULL); g_topology_lock(); @@ -205,8 +207,10 @@ g_sunlabel_config(struct gctl_req *req, struct g_geom *gp, const char *verb) return (EINVAL); /* XXX: Does this reference register with our selfdestruct code ? */ error = g_access_rel(cp, 1, 1, 1); - if (error) + if (error) { + g_free(label); return (error); + } for (i = 0; i < SUN_NPART; i++) { if (gsp->slices[i].length <= SUN_BOOTSIZE) continue; @@ -259,6 +263,7 @@ g_sunlabel_taste(struct g_class *mp, struct g_provider *pp, int flags) break; g_sunlabel_modify(gp, ms, buf); + g_free(buf); break; } while (0); |