Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/rump/librump/rumpvfs Fix memory leak on error case, as r...
details: https://anonhg.NetBSD.org/src/rev/60bcda2e0fc8
branches: trunk
changeset: 331635:60bcda2e0fc8
user: justin <justin%NetBSD.org@localhost>
date: Sun Aug 17 19:28:46 2014 +0000
description:
Fix memory leak on error case, as reported in
http://m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html#Report-2
diffstat:
sys/rump/librump/rumpvfs/rumpfs.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diffs (30 lines):
diff -r b16eac8f42fe -r 60bcda2e0fc8 sys/rump/librump/rumpvfs/rumpfs.c
--- a/sys/rump/librump/rumpvfs/rumpfs.c Sun Aug 17 19:12:59 2014 +0000
+++ b/sys/rump/librump/rumpvfs/rumpfs.c Sun Aug 17 19:28:46 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rumpfs.c,v 1.129 2014/06/13 15:45:02 pooka Exp $ */
+/* $NetBSD: rumpfs.c,v 1.130 2014/08/17 19:28:46 justin Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Antti Kantee. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.129 2014/06/13 15:45:02 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.130 2014/08/17 19:28:46 justin Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@@ -1740,8 +1740,10 @@
rn = makeprivate(VDIR, RUMPFS_DEFAULTMODE, NODEV, DEV_BSIZE, false);
rn->rn_parent = rn;
- if ((error = makevnode(mp, rn, &rfsmp->rfsmp_rvp)) != 0)
+ if ((error = makevnode(mp, rn, &rfsmp->rfsmp_rvp)) != 0) {
+ kmem_free(rfsmp, sizeof(*rfsmp));
return error;
+ }
rfsmp->rfsmp_rvp->v_vflag |= VV_ROOT;
Home |
Main Index |
Thread Index |
Old Index