summaryrefslogtreecommitdiff
path: root/source3/libads/ldap.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
commitbe8b0685a55700c6bce3681734800ec6434b0364 (patch)
tree8616d85686fb147d431eeea435233f45d5ee8d41 /source3/libads/ldap.c
parent79de0ad9463a5cd64978beae37df79fbb4f74632 (diff)
downloadsamba-be8b0685a55700c6bce3681734800ec6434b0364.tar.gz
samba-be8b0685a55700c6bce3681734800ec6434b0364.tar.bz2
samba-be8b0685a55700c6bce3681734800ec6434b0364.zip
r22589: Make TALLOC_ARRAY consistent across all uses.
Jeremy. (This used to be commit 8968808c3b5b0208cbad9ac92eaf948f2c546dd9)
Diffstat (limited to 'source3/libads/ldap.c')
-rw-r--r--source3/libads/ldap.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 6707cbd4d0..5a34385c32 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -2225,10 +2225,14 @@ int ads_count_replies(ADS_STRUCT *ads, void *res)
for (i=0; values[i]; i++)
/* nop */ ;
- (*sids) = TALLOC_ARRAY(mem_ctx, DOM_SID, i);
- if (!(*sids)) {
- ldap_value_free_len(values);
- return 0;
+ if (i) {
+ (*sids) = TALLOC_ARRAY(mem_ctx, DOM_SID, i);
+ if (!(*sids)) {
+ ldap_value_free_len(values);
+ return 0;
+ }
+ } else {
+ (*sids) = NULL;
}
count = 0;