From: Stefan Metzmacher Date: Wed, 5 Feb 2025 09:35:41 +0000 (+0100) Subject: libcli/lsarpc: fix talloc hierarchy in trust_forest_record_to_lsa() X-Git-Tag: tevent-0.17.0~714 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=126a3a26a67f9864bb1bd45c511fd8ff4b4515a6;p=thirdparty%2Fsamba.git libcli/lsarpc: fix talloc hierarchy in trust_forest_record_to_lsa() Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme --- diff --git a/libcli/lsarpc/util_lsarpc.c b/libcli/lsarpc/util_lsarpc.c index 7f62b025471..ed297846dc7 100644 --- a/libcli/lsarpc/util_lsarpc.c +++ b/libcli/lsarpc/util_lsarpc.c @@ -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;