From 9f193b747f399f7d8be42a198f81b0cafa67341d Mon Sep 17 00:00:00 2001 From: Swen Schillig Date: Mon, 5 Aug 2019 10:58:53 +0200 Subject: [PATCH] loadparm: fix mem leak found by ASAN MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ==24948==ERROR: LeakSanitizer: detected memory leaks Indirect leak of 232 byte(s) in 1 object(s) allocated from: #0 0x7fc44b971c08 in __interceptor_malloc (/lib64/libasan.so.5+0xefc08) #1 0x7fc44a2fe7b0 in __talloc_with_prefix ../../lib/talloc/talloc.c:782 #2 0x7fc44a2fe7b0 in __talloc ../../lib/talloc/talloc.c:824 #3 0x7fc44a2fe7b0 in _talloc_named_const ../../lib/talloc/talloc.c:981 #4 0x7fc44a2fe7b0 in _talloc_array ../../lib/talloc/talloc.c:2764 #5 0x7fc44a1239bc in str_list_make_v3 ../../lib/util/util_strlist_v3.c:58 #6 0x7fc44a123e3b in str_list_make_v3_const ../../lib/util/util_strlist_v3.c:127 #7 0x7fc44b14cc1a in init_globals ../../source3/param/loadparm.c:547 #8 0x7fc44b14deef in lp_load_ex ../../source3/param/loadparm.c:3876 #9 0x7fc44b14f97c in lp_load_initial_only ../../source3/param/loadparm.c:4025 #10 0x7fc44b479235 in cmdline_messaging_context ../../source3/lib/cmdline_contexts.c:34 #11 0x557cf59d642c in process_options ../../source3/utils/smbpasswd.c:200 #12 0x557cf59d642c in main ../../source3/utils/smbpasswd.c:633 #13 0x7fc4419f5412 in __libc_start_main (/lib64/libc.so.6+0x24412) Signed-off-by: Swen Schillig Reviewed-by: Matthias Dieter Wallnöfer Reviewed-by: Andrew Bartlett Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Sat Aug 10 20:42:39 UTC 2019 on sn-devel-184 --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0daac0e44cb..bcda6a1c600 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -545,7 +545,7 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals) init_printer_values(lp_ctx, Globals.ctx, &sDefault); - sDefault.ntvfs_handler = str_list_make_v3_const(NULL, "unixuid default", NULL); + sDefault.ntvfs_handler = str_list_make_v3_const(Globals.ctx, "unixuid default", NULL); DEBUG(3, ("Initialising global parameters\n")); -- 2.47.2