summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/winbindd/winbindd_ads.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/winbindd/winbindd_ads.c b/source3/winbindd/winbindd_ads.c
index 53ea3e148c..94e3bad7b2 100644
--- a/source3/winbindd/winbindd_ads.c
+++ b/source3/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 {