Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Don't trash the ref count of cred. It causes a memo...



details:   https://anonhg.NetBSD.org/src/rev/1fa37c869fde
branches:  trunk
changeset: 514687:1fa37c869fde
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Sep 08 15:34:06 2001 +0000

description:
Don't trash the ref count of cred. It causes a memory leak.

diffstat:

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

diffs (17 lines):

diff -r b7ab92521211 -r 1fa37c869fde sys/kern/vfs_syscalls.c
--- a/sys/kern/vfs_syscalls.c   Sat Sep 08 14:19:09 2001 +0000
+++ b/sys/kern/vfs_syscalls.c   Sat Sep 08 15:34:06 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_syscalls.c,v 1.169 2001/09/08 02:05:39 christos Exp $      */
+/*     $NetBSD: vfs_syscalls.c,v 1.170 2001/09/08 15:34:06 christos Exp $      */
 
 /*
  * Copyright (c) 1989, 1993
@@ -1901,6 +1901,7 @@
        struct nameidata nd;
 
        (void)memcpy(cred, p->p_ucred, sizeof(*cred));
+       cred->cr_ref = 1;
        cred->cr_uid = p->p_cred->p_ruid;
        cred->cr_gid = p->p_cred->p_rgid;
        NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE,



Home | Main Index | Thread Index | Old Index