diff options
Diffstat (limited to 'source3/libads/ldap.c')
-rw-r--r-- | source3/libads/ldap.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c index 6707cbd4d0f..5a34385c32a 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; |