From 2bd926accd7a4649fb83eb2a262f962277566b45 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Tue, 9 Jul 2019 18:05:09 +0200 Subject: [PATCH] s3:modules: pass a TALLOC_CTX to string_replace_init_map() Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- source3/lib/adouble.c | 3 ++- source3/modules/string_replace.c | 5 +++-- source3/modules/string_replace.h | 3 ++- source3/modules/vfs_catia.c | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/source3/lib/adouble.c b/source3/lib/adouble.c index 2ee5f9fab8a..bfb9fd2dac6 100644 --- a/source3/lib/adouble.c +++ b/source3/lib/adouble.c @@ -800,7 +800,8 @@ static bool ad_convert_xattr(vfs_handle_struct *handle, if (mappings == NULL) { return false; } - string_replace_cmaps = string_replace_init_map(mappings); + string_replace_cmaps = string_replace_init_map( + handle->conn->sconn, mappings); TALLOC_FREE(mappings); } diff --git a/source3/modules/string_replace.c b/source3/modules/string_replace.c index 88b53fbbf4a..df788667d1b 100644 --- a/source3/modules/string_replace.c +++ b/source3/modules/string_replace.c @@ -87,7 +87,8 @@ static bool build_ranges(struct char_mappings **cmaps, return True; } -struct char_mappings **string_replace_init_map(const char **mappings) +struct char_mappings **string_replace_init_map(TALLOC_CTX *mem_ctx, + const char **mappings) { int i; char *tmp; @@ -99,7 +100,7 @@ struct char_mappings **string_replace_init_map(const char **mappings) return NULL; } - cmaps = TALLOC_ZERO(NULL, MAP_NUM * sizeof(struct char_mappings *)); + cmaps = TALLOC_ZERO(mem_ctx, MAP_NUM * sizeof(struct char_mappings *)); if (cmaps == NULL) { return NULL; } diff --git a/source3/modules/string_replace.h b/source3/modules/string_replace.h index d7c9b52c85c..b33855efd07 100644 --- a/source3/modules/string_replace.h +++ b/source3/modules/string_replace.h @@ -22,7 +22,8 @@ struct char_mappings; -struct char_mappings **string_replace_init_map(const char **mappings); +struct char_mappings **string_replace_init_map(TALLOC_CTX *mem_ctx, + const char **mappings); NTSTATUS string_replace_allocate(connection_struct *conn, const char *name_in, diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c index 762491ede31..2c31c873fad 100644 --- a/source3/modules/vfs_catia.c +++ b/source3/modules/vfs_catia.c @@ -88,7 +88,7 @@ static struct share_mapping_entry *add_srt(int snum, const char **mappings) return sme; } - sme->mappings = string_replace_init_map(mappings); + sme->mappings = string_replace_init_map(sme, mappings); return sme; } -- 2.47.3