syslogd: Fix double free() warning after SIGHUP

This cleanup section has moved to *after* cfparse()

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson 2019-11-03 19:47:10 +01:00
parent 07475f60a1
commit ff27d39cca

View File

@ -2261,28 +2261,6 @@ void init(void)
logit("Called init.\n"); logit("Called init.\n");
Initialized = 0; Initialized = 0;
logit("Initializing log structures.\n");
SIMPLEQ_FOREACH(f, &fhead, f_link) {
/* flush any pending output */
if (f->f_prevcount)
fprintlog(f, NULL);
switch (f->f_type) {
case F_FILE:
case F_PIPE:
case F_TTY:
case F_CONSOLE:
if (f->f_file >= 0)
(void)close(f->f_file);
break;
case F_FORW:
case F_FORW_SUSP:
freeaddrinfo(f->f_un.f_forw.f_addr);
break;
}
}
/* Get hostname */ /* Get hostname */
(void)gethostname(LocalHostName, sizeof(LocalHostName)); (void)gethostname(LocalHostName, sizeof(LocalHostName));
LocalDomain = emptystring; LocalDomain = emptystring;