summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2005-03-16 20:48:13 +0000
committerpjd <pjd@FreeBSD.org>2005-03-16 20:48:13 +0000
commit84f16c193ca3d9104083b4fd617f6682db5a5475 (patch)
treeded18633f3cca2c821b980b2fdf3d389cc95a726 /sys
parentedeb9d81b0e10ba912c5810a921d024c302a527d (diff)
downloadFreeBSD-src-84f16c193ca3d9104083b4fd617f6682db5a5475.zip
FreeBSD-src-84f16c193ca3d9104083b4fd617f6682db5a5475.tar.gz
Plug memory leak.
Submitted by: Ted Unangst Found by: Coverity Prevent analysis tool Approved by: phk MFC after: 3 days
Diffstat (limited to 'sys')
-rw-r--r--sys/geom/geom_bsd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/geom/geom_bsd.c b/sys/geom/geom_bsd.c
index e4834a3..6b2220d 100644
--- a/sys/geom/geom_bsd.c
+++ b/sys/geom/geom_bsd.c
@@ -372,10 +372,9 @@ g_bsd_ioctl(struct g_provider *pp, u_long cmd, void *data, int fflag, struct thr
}
case DIOCSDINFO:
case DIOCWDINFO: {
- label = g_malloc(LABELSIZE, M_WAITOK);
-
if (!(fflag & FWRITE))
return (EPERM);
+ label = g_malloc(LABELSIZE, M_WAITOK);
/* The disklabel to set is the ioctl argument. */
bsd_disklabel_le_enc(label, data);
OpenPOWER on IntegriCloud