From 0c39fbc94ed6ad3aa18a6b3c15743707236f35c3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Matthias=20Dieter=20Walln=C3=B6fer?= Date: Sat, 13 Feb 2010 20:05:22 +0100 Subject: [PATCH] s4:loadparm.c - prevent memory leaks If a "logfile" was already set, free the content up before setting a new location. This can happen on a loadparm reload. --- source4/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c index 0841f7dad44..7b301d646fb 100644 --- a/source4/param/loadparm.c +++ b/source4/param/loadparm.c @@ -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; } -- 2.11.4.GIT