summaryrefslogtreecommitdiffstats
path: root/tools/syslogd.c
diff options
context:
space:
mode:
authorMarius Tomaschewski <mt@suse.com>2012-04-11 14:39:42 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-04-11 14:53:09 +0200
commita3a0acadb4aa9d09bde3a6951557939b0a0eeda6 (patch)
treec13744e85de796640de2c92bd091b4272f78df59 /tools/syslogd.c
parent6e6bf2ded8b7478772fe9e30a9643844fb320ad4 (diff)
downloadrsyslog-a3a0acadb4aa9d09bde3a6951557939b0a0eeda6.tar.gz
rsyslog-a3a0acadb4aa9d09bde3a6951557939b0a0eeda6.tar.xz
rsyslog-a3a0acadb4aa9d09bde3a6951557939b0a0eeda6.zip
Allocate LocalDomain as new string
LocalDomain points to "" or the domain in LocalHostName, allocate as new string before passing to SetLocalDomain or free will fail later. Signed-off-by: Marius Tomaschewski <mt@suse.com>
Diffstat (limited to 'tools/syslogd.c')
-rw-r--r--tools/syslogd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 183decb1..5e94beab 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -2404,6 +2404,9 @@ queryLocalHostname(void)
}
}
+ /* LocalDomain is "" or part of LocalHostName, allocate a new string */
+ CHKmalloc(LocalDomain = (uchar*)strdup(LocalDomain));
+
/* Convert to lower case to recognize the correct domain laterly */
for(p = LocalDomain ; *p ; p++)
*p = (char)tolower((int)*p);