From 9a36eaa36e220f4773ad648cb0ce66137777709b Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Tue, 8 May 2012 19:47:52 +0000 Subject: Plug a leak. Submitted by: Greg Bednarek MFC after: 1 week --- lib/libc/rpc/auth_unix.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/libc/rpc/auth_unix.c b/lib/libc/rpc/auth_unix.c index ff3ca7b675c0c..c0d25483adf20 100644 --- a/lib/libc/rpc/auth_unix.c +++ b/lib/libc/rpc/auth_unix.c @@ -185,6 +185,7 @@ authunix_create(machname, uid, gid, len, aup_gids) 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); } /* -- cgit v1.2.3