Plug memory leak.

Submitted by:	Ted Unangst
Found by:	Coverity Prevent analysis tool
Approved by:	phk
MFC after:	3 days
This commit is contained in:
Pawel Jakub Dawidek 2005-03-16 20:48:13 +00:00
parent 402f124a2b
commit 42cfb5bada

View File

@ -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);