From: Günther Deschner Date: Tue, 2 Sep 2008 19:51:30 +0000 (+0200) Subject: winbindd: the ad trusted_domains call should return talloced strings. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b57cbf62e8180c8fdb8f541c43358d36d8dbbdfa;p=thirdparty%2Fsamba.git winbindd: the ad trusted_domains call should return talloced strings. Guenther --- diff --git a/source/winbindd/winbindd_ads.c b/source/winbindd/winbindd_ads.c index 53ea3e148c1..94e3bad7b23 100644 --- a/source/winbindd/winbindd_ads.c +++ b/source/winbindd/winbindd_ads.c @@ -1239,8 +1239,11 @@ static NTSTATUS trusted_domains(struct winbindd_domain *domain, continue; } - (*names)[ret_count] = CONST_DISCARD(char *, trusts.array[i].netbios_name); - (*alt_names)[ret_count] = CONST_DISCARD(char *, trusts.array[i].dns_name); + (*names)[ret_count] = talloc_strdup(mem_ctx, trusts.array[i].netbios_name); + (*alt_names)[ret_count] = talloc_strdup(mem_ctx, trusts.array[i].dns_name); + if ((*names)[ret_count] == NULL) { + return NT_STATUS_NO_MEMORY; + } if (trusts.array[i].sid) { sid_copy(&(*dom_sids)[ret_count], trusts.array[i].sid); } else {