Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Memory leak (only triggerable from root).



details:   https://anonhg.NetBSD.org/src/rev/8a6a06120479
branches:  trunk
changeset: 795554:8a6a06120479
user:      maxv <maxv%NetBSD.org@localhost>
date:      Fri Apr 18 05:22:13 2014 +0000

description:
Memory leak (only triggerable from root).

ok christos@

diffstat:

 sys/kern/vfs_syscalls.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (41 lines):

diff -r ff746029cf38 -r 8a6a06120479 sys/kern/vfs_syscalls.c
--- a/sys/kern/vfs_syscalls.c   Fri Apr 18 02:41:32 2014 +0000
+++ b/sys/kern/vfs_syscalls.c   Fri Apr 18 05:22:13 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_syscalls.c,v 1.480 2014/04/16 19:25:28 maxv Exp $  */
+/*     $NetBSD: vfs_syscalls.c,v 1.481 2014/04/18 05:22:13 maxv Exp $  */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.480 2014/04/16 19:25:28 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.481 2014/04/18 05:22:13 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_fileassoc.h"
@@ -1981,6 +1981,7 @@
                goto bad;
        }
        error = vfs_fhtovp(fh, &vp);
+       vfs_copyinfh_free(fh);
        if (error != 0) {
                goto bad;
        }
@@ -2018,14 +2019,12 @@
        VOP_UNLOCK(vp);
        *retval = indx;
        fd_affix(p, fp, indx);
-       vfs_copyinfh_free(fh);
        return (0);
 
 bad:
        fd_abort(p, fp, indx);
        if (vp != NULL)
                vput(vp);
-       vfs_copyinfh_free(fh);
        return (error);
 }
 



Home | Main Index | Thread Index | Old Index