From 14bae61ba36814ea5eca7c51cf1cc039e9e6803f Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 18 Feb 2013 16:36:22 +0100 Subject: winbind: Use talloc for allocating domain, dns, forest and dc name. Reviewed-by: David Disseldorp --- source3/winbindd/winbindd_cache.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'source3/winbindd/winbindd_cache.c') diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c index d0603d11c9..0e47a38f15 100644 --- a/source3/winbindd/winbindd_cache.c +++ b/source3/winbindd/winbindd_cache.c @@ -4619,10 +4619,15 @@ static struct winbindd_tdc_domain *wcache_tdc_dup_domain( if (dst->domain_name == NULL) { goto fail; } - dst->dns_name = talloc_strdup(dst, src->dns_name); - if (dst->dns_name == NULL) { - goto fail; + + dst->dns_name = NULL; + if (src->dns_name != NULL) { + dst->dns_name = talloc_strdup(dst, src->dns_name); + if (dst->dns_name == NULL) { + goto fail; + } } + sid_copy(&dst->sid, &src->sid); dst->trust_flags = src->trust_flags; dst->trust_type = src->trust_type; -- cgit