Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Jan 2003 15:41:36 -0800 (PST)
From:      David Wang <dsw@juniper.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/46845: inetd memory leak when built with LOGIN_CAP
Message-ID:  <200301072341.h07NfaQ01188@sophia.juniper.net>

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

>Number:         46845
>Category:       bin
>Synopsis:       inetd memory leak when built with LOGIN_CAP
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 07 15:50:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     David Wang
>Release:        FreeBSD 4.2-STABLE i386
>Organization:
Juniper Networks
>Environment:
System: FreeBSD sophia.juniper.net 4.5-RELEASE FreeBSD 4.5-RELEASE #0: Sat Mar 23 12:22:23 PST 2002 root@sophia:/usr/src/sys/compile/Juniper i386

>Description:
With LOGIN_CAP defined during compilation, inetd.c calls login_getclass(), 
which returns a dynamically-allocated chunk of memory of size 
sizeof(login_cap_t).  login_close() should be called at some point to 
free up this chunk of memory, but login_close() is never called in inetd.c.

Note that other code in FreeBSD does call login_close() to free up 
memory allocated by login_getclass() and friends.

I saw this behavior in FreeBSD 4.2 but it seems that the problem exists in 
all versions of FreeBSD.

>How-To-Repeat:
Build inetd with LOGIN_CAP defined, and send SIGHUPs to the resulting 
inetd executable.  'ps ux | grep inetd' output will show the memory 
being used by inetd will go up.

>Fix:
Call login_close() after calls to login_getclass(), if the login_cap_t 
that is allocated is not needed anymore.  This will especially help in 
the loop inside config().

>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?200301072341.h07NfaQ01188>