s4:loadparm.c - the logfile parameter value needs to be duplicated
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Sat, 13 Feb 2010 18:41:43 +0000 (19:41 +0100)
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Sat, 13 Feb 2010 18:41:43 +0000 (19:41 +0100)
Otherwise the "logfile" pointer tracks all changes of "pszParmValue" which
content is only temporal. This was the cause of bug #6212.

source4/param/loadparm.c

index cb23ceab02e1d8b87d4ddfeadf1c388601c2c0ba..0841f7dad44e0e33c174d5b487bf7bc6dd2bf499 100644 (file)
@@ -1542,7 +1542,7 @@ static bool handle_debuglevel(struct loadparm_context *lp_ctx,
 static bool handle_logfile(struct loadparm_context *lp_ctx,
                        const char *pszParmValue, char **ptr)
 {
-       logfile = pszParmValue;
+       logfile = strdup(pszParmValue);
        return true;
 }