summaryrefslogtreecommitdiffstats
path: root/source/auth/auth_util.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-04-30 02:39:34 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:19:49 -0500
commit8968808c3b5b0208cbad9ac92eaf948f2c546dd9 (patch)
tree26d539cf26e3ca30d5ead10c6b9257134783024a /source/auth/auth_util.c
parent8ad13718af0ba1fcb10a6f1631b1ed3cb8d11175 (diff)
downloadsamba-8968808c3b5b0208cbad9ac92eaf948f2c546dd9.tar.gz
samba-8968808c3b5b0208cbad9ac92eaf948f2c546dd9.tar.xz
samba-8968808c3b5b0208cbad9ac92eaf948f2c546dd9.zip
r22589: Make TALLOC_ARRAY consistent across all uses.
Jeremy.
Diffstat (limited to 'source/auth/auth_util.c')
-rw-r--r--source/auth/auth_util.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source/auth/auth_util.c b/source/auth/auth_util.c
index e2bc8e75b5e..db92c50df05 100644
--- a/source/auth/auth_util.c
+++ b/source/auth/auth_util.c
@@ -834,11 +834,15 @@ NTSTATUS create_token_from_username(TALLOC_CTX *mem_ctx, const char *username,
goto done;
}
- group_sids = TALLOC_ARRAY(tmp_ctx, DOM_SID, num_group_sids);
- if (group_sids == NULL) {
- DEBUG(1, ("TALLOC_ARRAY failed\n"));
- result = NT_STATUS_NO_MEMORY;
- goto done;
+ if (num_group_sids) {
+ group_sids = TALLOC_ARRAY(tmp_ctx, DOM_SID, num_group_sids);
+ if (group_sids == NULL) {
+ DEBUG(1, ("TALLOC_ARRAY failed\n"));
+ result = NT_STATUS_NO_MEMORY;
+ goto done;
+ }
+ } else {
+ group_sids = NULL;
}
for (i=0; i<num_group_sids; i++) {