From a3a0acadb4aa9d09bde3a6951557939b0a0eeda6 Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski Date: Wed, 11 Apr 2012 14:39:42 +0200 Subject: 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 --- tools/syslogd.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tools/syslogd.c') 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); -- cgit