From: Volker Lendecke Date: Wed, 1 Jul 2026 15:03:17 +0000 (+0200) Subject: auth3: Put "module_name" on the stack X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=92157d268b316cf6057d2dc4d195676a2736aea8;p=thirdparty%2Fsamba.git auth3: Put "module_name" on the stack Avoid having to do a SAFE_FREE Signed-off-by: Volker Lendecke Reviewed-by: Anoop C S --- diff --git a/source3/auth/auth.c b/source3/auth/auth.c index 5dd8dba6a49..a8e93ffe446 100644 --- a/source3/auth/auth.c +++ b/source3/auth/auth.c @@ -422,7 +422,7 @@ static bool load_auth_module( static bool initialised_static_modules = False; struct auth_init_function_entry *entry; - char *module_name = smb_xstrdup(module); + char module_name[strlen(module) + 1]; char *module_params = NULL; char *p; bool good = False; @@ -436,6 +436,8 @@ static bool load_auth_module( DEBUG(5,("load_auth_module: Attempting to find an auth method to match %s\n", module)); + memcpy(module_name, module, sizeof(module_name)); + p = strchr(module_name, ':'); if (p) { *p = 0; @@ -466,7 +468,6 @@ static bool load_auth_module( DEBUG(0,("load_auth_module: can't find auth method %s!\n", module_name)); } - SAFE_FREE(module_name); return good; }