summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-07-30 10:50:35 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-07-30 10:50:35 +0000
commit6313a3417605fff4a40e367954c3fcbf79d321d5 (patch)
tree9b4452ca05f48f0bb0f3dae7d69f5f9b81123032
parent9f12ca0ac86a7d29bdc6518a39b69cd03af41406 (diff)
downloadrsyslog-6313a3417605fff4a40e367954c3fcbf79d321d5.tar.gz
rsyslog-6313a3417605fff4a40e367954c3fcbf79d321d5.tar.xz
rsyslog-6313a3417605fff4a40e367954c3fcbf79d321d5.zip
- fixed a memory leak in syslogd/init() that happend when the config file
could not be read - thanks to varmojfekoj for the patch
-rw-r--r--ChangeLog2
-rw-r--r--syslogd.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index de853a66..26e7be8b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,8 @@ Version 1.17.6 (rgerhards), 2007-07-3?
templates
- fixed a mem leak in OMSRdestruct - freeing the object itself was
forgotten - thanks to varmojfekoj for the patch
+- fixed a memory leak in syslogd/init() that happend when the config
+ file could not be read - thanks to varmojfekoj for the patch
---------------------------------------------------------------------------
Version 1.17.5 (rgerhards), 2007-07-30
- continued to work on modularization
diff --git a/syslogd.c b/syslogd.c
index 681f7383..8ee890f1 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -4038,9 +4038,9 @@ static void init()
cfline("*.ERR\t" _PATH_CONSOLE, nextp);
nextp->f_next = (selector_t *)calloc(1, sizeof(selector_t));
cfline("*.PANIC\t*", nextp->f_next);
- nextp->f_next = (selector_t *)calloc(1, sizeof(selector_t));
+ nextp->f_next->f_next = (selector_t *)calloc(1, sizeof(selector_t));
snprintf(cbuf,sizeof(cbuf), "*.*\t%s", ttyname(0));
- cfline(cbuf, nextp->f_next);
+ cfline(cbuf, nextp->f_next->f_next);
Initialized = 1;
}
else { /* we should consider moving this into a separate function, its lengthy... */