Fix memleak in groupdb. Spotted by Metze
authorAlexander Bokovoy <ab@samba.org>
Fri, 4 Jul 2003 09:56:50 +0000 (09:56 +0000)
committerAlexander Bokovoy <ab@samba.org>
Fri, 4 Jul 2003 09:56:50 +0000 (09:56 +0000)
(This used to be commit 5280c6953195c2664628ecaab59ea82b4863e8f7)

source3/groupdb/mapping.c

index ef243ecfc08f7047158f4a8e44c03747e2d1ecb2..5d2d28f152604d755ab7a65af0000df796205e6b 100644 (file)
@@ -683,8 +683,8 @@ BOOL get_uid_list_of_group(gid_t gid, uid_t **uid, int *num_uids)
                if( (pwd=getpwnam_alloc(gr)) !=NULL) {
                        (*uid)[*num_uids]=pwd->pw_uid;
                        (*num_uids)++;
+                       passwd_free(&pwd);
                }
-               passwd_free(&pwd);
                gr = grp->gr_mem[++i];
        }
        DEBUG(10, ("got [%d] members\n", *num_uids));