summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Latifi <pat@cvs.openbsd.org>2006-06-14 16:40:16 +0000
committerPatrick Latifi <pat@cvs.openbsd.org>2006-06-14 16:40:16 +0000
commita2a2144c3ec65015ce96fe4236be40610800bc52 (patch)
treeeac0748f8e5fa8eae04ee1ffd97f5b0b6f5c4640
parenteac968f50db56d4ea1eb00ba224346a054ca1a7b (diff)
Plug memory leak in error path; ok pedro@
-rw-r--r--sys/isofs/udf/udf_vfsops.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/isofs/udf/udf_vfsops.c b/sys/isofs/udf/udf_vfsops.c
index 867a2f726d6..69353c107c8 100644
--- a/sys/isofs/udf/udf_vfsops.c
+++ b/sys/isofs/udf/udf_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udf_vfsops.c,v 1.6 2006/01/14 23:59:32 pedro Exp $ */
+/* $OpenBSD: udf_vfsops.c,v 1.7 2006/06/14 16:40:15 pat Exp $ */
/*
* Copyright (c) 2001, 2002 Scott Long <scottl@freebsd.org>
@@ -239,7 +239,8 @@ udf_checktag(struct desc_tag *tag, uint16_t id)
}
int
-udf_mountfs(struct vnode *devvp, struct mount *mp, struct proc *p) {
+udf_mountfs(struct vnode *devvp, struct mount *mp, struct proc *p)
+{
struct buf *bp = NULL;
struct anchor_vdp avdp;
struct udf_mnt *udfmp = NULL;
@@ -408,14 +409,17 @@ udf_mountfs(struct vnode *devvp, struct mount *mp, struct proc *p) {
return (0);
bail:
- if (udfmp != NULL)
+ if (udfmp != NULL) {
FREE(udfmp, M_UDFMOUNT);
+ mp->mnt_data = NULL;
+ mp->mnt_flag &= ~MNT_LOCAL;
+ }
if (bp != NULL)
brelse(bp);
VOP_CLOSE(devvp, FREAD, FSCRED, p);
return (error);
-};
+}
int
udf_unmount(struct mount *mp, int mntflags, struct proc *p)
@@ -578,6 +582,7 @@ udf_vget(struct mount *mp, ino_t ino, struct vnode **vpp)
if ((error = udf_allocv(mp, &vp, p))) {
printf("Error from udf_allocv\n");
+ FREE(unode->fentry, M_UDFFENTRY);
pool_put(&udf_node_pool, unode);
return (error);
}