summaryrefslogtreecommitdiff
path: root/source4/param
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2010-02-13 20:05:22 +0100
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2010-02-13 20:05:22 +0100
commit0c39fbc94ed6ad3aa18a6b3c15743707236f35c3 (patch)
tree7cf5bb0d336733774e6f808cb1491432b27917f9 /source4/param
parent195bda569e541a49ab3406deca8c8b864ec327d4 (diff)
downloadsamba-0c39fbc94ed6ad3aa18a6b3c15743707236f35c3.tar.gz
samba-0c39fbc94ed6ad3aa18a6b3c15743707236f35c3.tar.bz2
samba-0c39fbc94ed6ad3aa18a6b3c15743707236f35c3.zip
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.
Diffstat (limited to 'source4/param')
-rw-r--r--source4/param/loadparm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c
index 0841f7dad4..7b301d646f 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;
}