]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libcli/lsarpc: fix talloc hierarchy in trust_forest_record_to_lsa()
authorStefan Metzmacher <metze@samba.org>
Wed, 5 Feb 2025 09:35:41 +0000 (10:35 +0100)
committerRalph Boehme <slow@samba.org>
Sat, 22 Feb 2025 16:00:36 +0000 (16:00 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
libcli/lsarpc/util_lsarpc.c

index 7f62b02547197d86a7726288063daa70f2df0c5a..ed297846dc79bc674274a68501f84967b2533ed7 100644 (file)
@@ -488,7 +488,7 @@ static NTSTATUS trust_forest_record_to_lsa(TALLOC_CTX *mem_ctx,
                lstr = &lftr->forest_trust_data.top_level_name;
                str = &ftr->data.name;
 
-               lstr->string = talloc_strdup(mem_ctx, str->string);
+               lstr->string = talloc_strdup(lftr, str->string);
                if (lstr->string == NULL) {
                        TALLOC_FREE(lftr);
                        return NT_STATUS_NO_MEMORY;
@@ -500,7 +500,7 @@ static NTSTATUS trust_forest_record_to_lsa(TALLOC_CTX *mem_ctx,
                lstr = &lftr->forest_trust_data.top_level_name_ex;
                str = &ftr->data.name;
 
-               lstr->string = talloc_strdup(mem_ctx, str->string);
+               lstr->string = talloc_strdup(lftr, str->string);
                if (lstr->string == NULL) {
                        TALLOC_FREE(lftr);
                        return NT_STATUS_NO_MEMORY;
@@ -520,7 +520,7 @@ static NTSTATUS trust_forest_record_to_lsa(TALLOC_CTX *mem_ctx,
 
                lstr = &linfo->dns_domain_name;
                str = &info->dns_name;
-               lstr->string = talloc_strdup(mem_ctx, str->string);
+               lstr->string = talloc_strdup(lftr, str->string);
                if (lstr->string == NULL) {
                        TALLOC_FREE(lftr);
                        return NT_STATUS_NO_MEMORY;
@@ -528,7 +528,7 @@ static NTSTATUS trust_forest_record_to_lsa(TALLOC_CTX *mem_ctx,
 
                lstr = &linfo->netbios_domain_name;
                str = &info->netbios_name;
-               lstr->string = talloc_strdup(mem_ctx, str->string);
+               lstr->string = talloc_strdup(lftr, str->string);
                if (lstr->string == NULL) {
                        TALLOC_FREE(lftr);
                        return NT_STATUS_NO_MEMORY;