Coverity CID 2860: Free malloced resources on mount error.

This commit is contained in:
christos 2006-04-11 14:12:53 +00:00
parent 888007e5cb
commit 139332cff1
1 changed files with 8 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ntfs_vfsops.c,v 1.37 2006/02/21 04:32:39 thorpej Exp $ */ /* $NetBSD: ntfs_vfsops.c,v 1.38 2006/04/11 14:12:53 christos Exp $ */
/*- /*-
* Copyright (c) 1998, 1999 Semen Ustimenko * Copyright (c) 1998, 1999 Semen Ustimenko
@ -29,7 +29,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ntfs_vfsops.c,v 1.37 2006/02/21 04:32:39 thorpej Exp $"); __KERNEL_RCSID(0, "$NetBSD: ntfs_vfsops.c,v 1.38 2006/04/11 14:12:53 christos Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -573,6 +573,12 @@ out:
if (bp) if (bp)
brelse(bp); brelse(bp);
if (error) {
if (ntmp->ntm_ad)
free(ntmp->ntm_ad, M_NTFSMNT);
free(ntmp, M_NTFSMNT);
}
return (error); return (error);
} }