svn commit: r235468 - stable/8/lib/libc/rpc

Konstantin Belousov kib at FreeBSD.org
Tue May 15 09:37:23 UTC 2012


Author: kib
Date: Tue May 15 09:37:22 2012
New Revision: 235468
URL: http://svn.freebsd.org/changeset/base/235468

Log:
  MFC r235143:
  Plug a leak.

Modified:
  stable/8/lib/libc/rpc/auth_unix.c
Directory Properties:
  stable/8/lib/libc/   (props changed)

Modified: stable/8/lib/libc/rpc/auth_unix.c
==============================================================================
--- stable/8/lib/libc/rpc/auth_unix.c	Tue May 15 09:28:25 2012	(r235467)
+++ stable/8/lib/libc/rpc/auth_unix.c	Tue May 15 09:37:22 2012	(r235468)
@@ -185,6 +185,7 @@ authunix_create(machname, uid, gid, len,
 AUTH *
 authunix_create_default()
 {
+	AUTH *auth;
 	int ngids;
 	long ngids_max;
 	char machname[MAXHOSTNAMELEN + 1];
@@ -207,8 +208,10 @@ authunix_create_default()
 	if (ngids > NGRPS)
 		ngids = NGRPS;
 	/* XXX: interface problem; those should all have been unsigned */
-	return (authunix_create(machname, (int)uid, (int)gid, ngids,
-	    (int *)gids));
+	auth = authunix_create(machname, (int)uid, (int)gid, ngids,
+	    (int *)gids);
+	free(gids);
+	return (auth);
 }
 
 /*


More information about the svn-src-stable mailing list