s4:loadparm.c - prevent memory leaks
[ira/wip.git] / source4 / param / loadparm.c
index 0841f7dad44e0e33c174d5b487bf7bc6dd2bf499..7b301d646fb30f9b0364467b1104336fb895809c 100644 (file)
@@ -1542,6 +1542,9 @@ static bool handle_debuglevel(struct loadparm_context *lp_ctx,
 static bool handle_logfile(struct loadparm_context *lp_ctx,
                        const char *pszParmValue, char **ptr)
 {
+       if (logfile != NULL) {
+               free(discard_const_p(char, logfile));
+       }
        logfile = strdup(pszParmValue);
        return true;
 }