Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Mar 2001 16:34:26 -0800 (PST)
From:      davidx@viasoft.com.cn
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/25932: possible memory leak in /sys/kern/kern_proc.c
Message-ID:  <200103200034.f2K0YQU26430@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help


>Number:         25932
>Category:       kern
>Synopsis:       possible memory leak in /sys/kern/kern_proc.c
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 19 16:40:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     David Xu
>Release:        FreeBSD 4.3-BETA
>Organization:
Viasoft
>Environment:
FreeBSD davidbsd.viasoft.com.cn 4.3-BETA FreeBSD 4.3-BETA #0: Mon Mar 19 10:55:5
7 CST 2001     root@davidbsd.viasoft.com.cn:/usr/obj/usr/src/sys/xu  i386
>Description:
a possible memory leak exists in /sys/kern/kern_proc.c, in function 
enterpgrp(), before returns ESRCH, it does not free pre-allocated pgrp,
hope I am not making a mistake.

>How-To-Repeat:

>Fix:
a patch is available:

--- kern_proc.c.orig    Tue Mar 20 08:22:37 2001
+++ kern_proc.c Tue Mar 20 08:22:57 2001
@@ -157,10 +157,10 @@
         */
        KASSERT(p->p_pid == pgid,
            ("enterpgrp: new pgrp and pid != pgid"));
-       MALLOC(pgrp, struct pgrp *, sizeof(struct pgrp), M_PGRP,
-           M_WAITOK);
        if ((np = pfind(savepid)) == NULL || np != p)
            return (ESRCH);
+       MALLOC(pgrp, struct pgrp *, sizeof(struct pgrp), M_PGRP,
+           M_WAITOK);
        if (mksess) {
            register struct session *sess;
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103200034.f2K0YQU26430>