misc/167068: memory leak in authunix_create_default()

Brian Jones bjones at alacritech.com
Wed Apr 18 17:20:05 UTC 2012

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

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

compile and run this test program:  Monitor RSS with ps.

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

  AUTH            *auth;
  for(;;) {
     auth = authunix_create_default();
diff 8.0/src/lib/libc/rpc/auth_unix.c local/src/lib/libc/rpc/auth_unix.c 
>       AUTH *au;
<       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;


More information about the freebsd-bugs mailing list