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
>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 at 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:


More information about the freebsd-bugs mailing list