summaryrefslogtreecommitdiffstats
path: root/source/lib/system_smbd.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2007-02-28 14:35:26 +0000
committerGerald Carter <jerry@samba.org>2007-02-28 14:35:26 +0000
commit80236f0d60ce013134c1ed5422d148e541f70a4f (patch)
treef71326fa71c0323e6b5d87b75b289d0608480f87 /source/lib/system_smbd.c
parentf05f5dce39b11e937fb19270b7bcc888582edf35 (diff)
downloadsamba-80236f0d60ce013134c1ed5422d148e541f70a4f.tar.gz
samba-80236f0d60ce013134c1ed5422d148e541f70a4f.tar.xz
samba-80236f0d60ce013134c1ed5422d148e541f70a4f.zip
r21585: Start syncing the monster that will become 3.0.25pre1
Still todo: * release notes * few minor outstanding patches * additional idmap man pages
Diffstat (limited to 'source/lib/system_smbd.c')
-rw-r--r--source/lib/system_smbd.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/source/lib/system_smbd.c b/source/lib/system_smbd.c
index fc506c901db..509b2bbcb1e 100644
--- a/source/lib/system_smbd.c
+++ b/source/lib/system_smbd.c
@@ -181,11 +181,18 @@ BOOL getgroups_unix_user(TALLOC_CTX *mem_ctx, const char *user,
groups = NULL;
/* Add in primary group first */
- add_gid_to_array_unique(mem_ctx, primary_gid, &groups, &ngrp);
+ if (!add_gid_to_array_unique(mem_ctx, primary_gid, &groups, &ngrp)) {
+ SAFE_FREE(temp_groups);
+ return False;
+ }
- for (i=0; i<max_grp; i++)
- add_gid_to_array_unique(mem_ctx, temp_groups[i],
- &groups, &ngrp);
+ for (i=0; i<max_grp; i++) {
+ if (!add_gid_to_array_unique(mem_ctx, temp_groups[i],
+ &groups, &ngrp)) {
+ SAFE_FREE(temp_groups);
+ return False;
+ }
+ }
*p_ngroups = ngrp;
*ret_groups = groups;