Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Feb 2000 15:20:14 -0800 (PST)
From:      vova@express.ru
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/17084: memory leak in getcap.c (libc)
Message-ID:  <200002292320.PAA93631@freefall.freebsd.org>

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

>Number:         17084
>Category:       bin
>Synopsis:       memory leak in getcap.c (libc)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 29 15:30:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Vladimir B. Grebenschikov
>Release:        FreeBSD-4.0-CURRENT
>Organization:
TSB Russian Express
>Environment:
FreeBSD lightning.express.ru 4.0-CURRENT FreeBSD 4.0-CURRENT #3: Sun Feb 27 09:26:03 MSK 2000     root@lightning.express.ru:/usr/local/src/fbsd/src/sys/compile/LIGHTNING  i386

>Description:
Compile ang run program below
and all your memory will eaten very quckly
each itteration "eats" about 1.5k memory
---
I have dip a bit into problem and found that memory leaks in
cgetent() called from login_getclassbyname()
>How-To-Repeat:
#include <stdio.h>
#include <sys/types.h>
#include <login_cap.h>
#include <pwd.h>


main()
{

  struct passwd *ent;
  int uid;
  
  ent = getpwnam("nobody"); 
  while(1) {
    login_cap_t *lc;
    uid = ent->pw_uid;
    if ( (lc = login_getclassbyname("root", ent)) == NULL )
                perror("login_getclassbyname: ");
    login_close(lc);      
  }
}

>Fix:
don't know

>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?200002292320.PAA93631>