summaryrefslogtreecommitdiff
path: root/source3/libads/dns.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/libads/dns.c')
-rw-r--r--source3/libads/dns.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source3/libads/dns.c b/source3/libads/dns.c
index 8b031b0e3a..f16cea2555 100644
--- a/source3/libads/dns.c
+++ b/source3/libads/dns.c
@@ -355,10 +355,14 @@ static NTSTATUS ads_dns_lookup_srv( TALLOC_CTX *ctx, const char *name, struct dn
DEBUG(4,("ads_dns_lookup_srv: %d records returned in the answer section.\n",
answer_count));
- if ( (dcs = TALLOC_ZERO_ARRAY(ctx, struct dns_rr_srv, answer_count)) == NULL ) {
- DEBUG(0,("ads_dns_lookup_srv: talloc() failure for %d char*'s\n",
- answer_count));
- return NT_STATUS_NO_MEMORY;
+ if (answer_count) {
+ if ( (dcs = TALLOC_ZERO_ARRAY(ctx, struct dns_rr_srv, answer_count)) == NULL ) {
+ DEBUG(0,("ads_dns_lookup_srv: talloc() failure for %d char*'s\n",
+ answer_count));
+ return NT_STATUS_NO_MEMORY;
+ }
+ } else {
+ dcs = NULL;
}
/* now skip the header */