Source-Changes-HG archive

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

[src/netbsd-1-4]: src/sys/miscfs/procfs Pull up revision 1.8 (requested by si...



details:   https://anonhg.NetBSD.org/src/rev/dd2678f8db34
branches:  netbsd-1-4
changeset: 470637:dd2678f8db34
user:      he <he%NetBSD.org@localhost>
date:      Thu Jun 01 18:07:32 2000 +0000

description:
Pull up revision 1.8 (requested by simonb):
  Fix a possible kernel memory leak - if the command line of a
  process was requested after it had started to exit but before it
  became a zombie a page of kernel memory would not be freed.

diffstat:

 sys/miscfs/procfs/procfs_cmdline.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 08bdf93b4694 -r dd2678f8db34 sys/miscfs/procfs/procfs_cmdline.c
--- a/sys/miscfs/procfs/procfs_cmdline.c        Thu Jun 01 18:04:43 2000 +0000
+++ b/sys/miscfs/procfs/procfs_cmdline.c        Thu Jun 01 18:07:32 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: procfs_cmdline.c,v 1.4.2.1 1999/04/27 13:57:38 perry Exp $     */
+/*     $NetBSD: procfs_cmdline.c,v 1.4.2.2 2000/06/01 18:07:32 he Exp $        */
 
 /*
  * Copyright (c) 1999 Jaromir Dolecek <dolecek%ics.muni.cz@localhost>
@@ -98,8 +98,10 @@
         * Lock the process down in memory.
         */
        /* XXXCDC: how should locking work here? */
-       if ((p->p_flag & P_WEXIT) || (p->p_vmspace->vm_refcnt < 1))
+       if ((p->p_flag & P_WEXIT) || (p->p_vmspace->vm_refcnt < 1)) {
+               free(arg, M_TEMP);
                return (EFAULT);
+       }
        PHOLD(p);
        p->p_vmspace->vm_refcnt++;      /* XXX */
 



Home | Main Index | Thread Index | Old Index