Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Apr 2012 17:13:27 GMT
From:      Brian Jones <bjones@alacritech.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/167068: memory leak in authunix_create_default()
Message-ID:  <201204181713.q3IHDRIS011917@red.freebsd.org>
Resent-Message-ID: <201204181720.q3IHK4K3058096@freefall.freebsd.org>

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

>Number:         167068
>Category:       misc
>Synopsis:       memory leak in authunix_create_default()
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 18 17:20:04 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Brian Jones
>Release:        8.0, 8.2, 9.0
>Organization:
Alacritech, Inc
>Environment:
FreeBSD nameserver.alacritech.com 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Sat Nov 21 15:02:08 UTC 2009     root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
In src/lib/libc/rpc/auth_unix.c:authunix_create_default(), gids is never freed.


>How-To-Repeat:
compile and run this test program:  Monitor RSS with ps.

----PGM_START----
#include <stdio.h>
#include <rpc/rpc.h>

main()
{
  AUTH            *auth;
  for(;;) {
     auth = authunix_create_default();
     auth_destroy(auth);
  }
  return(0);
}
----PGM_END----
>Fix:
diff 8.0/src/lib/libc/rpc/auth_unix.c local/src/lib/libc/rpc/auth_unix.c 
193a194
>       AUTH *au;
210,211c211,214
<       return (authunix_create(machname, (int)uid, (int)gid, ngids,
<           (int *)gids));
---
>       au = authunix_create(machname, (int)uid, (int)gid, ngids,
>           (int *)gids);
>       free(gids);
>       return au;

>Release-Note:
>Audit-Trail:
>Unformatted:



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