summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/auth/auth_sam.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source4/auth/auth_sam.c b/source4/auth/auth_sam.c
index e7f428c922..481c8d3790 100644
--- a/source4/auth/auth_sam.c
+++ b/source4/auth/auth_sam.c
@@ -335,7 +335,8 @@ static NTSTATUS check_sam_security(const struct auth_context *auth_context,
"(&(member=%s)(sAMAccountType=*))",
dn);
- if (!(groupSIDs = talloc_realloc_p((*server_info)->mem_ctx, groupSIDs,
+ if (group_ret > 0 &&
+ !(groupSIDs = talloc_realloc_p((*server_info)->mem_ctx, groupSIDs,
struct dom_sid *, group_ret))) {
talloc_destroy((*server_info)->mem_ctx);
samdb_close(sam_ctx);