]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
winbindd: the ad trusted_domains call should return talloced strings.
authorGünther Deschner <gd@samba.org>
Tue, 2 Sep 2008 19:51:30 +0000 (21:51 +0200)
committerGünther Deschner <gd@samba.org>
Tue, 2 Sep 2008 19:53:04 +0000 (21:53 +0200)
Guenther

source/winbindd/winbindd_ads.c

index 53ea3e148c16baff9c5477496bd36da092445277..94e3bad7b2331fcc761226dbcc3f030a4fd86237 100644 (file)
@@ -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 {