From c8fb552eeabd1a7cd9440d55c96918c0aa1ae3a9 Mon Sep 17 00:00:00 2001 From: Salih Gonullu Date: Sat, 26 Mar 2011 21:51:28 +0100 Subject: ulogd: fix segfault if syslog and SIGTERM is received Signed-off-by: Pablo Neira Ayuso --- src/ulogd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ulogd.c b/src/ulogd.c index a4b0ed1..c065c2f 100644 --- a/src/ulogd.c +++ b/src/ulogd.c @@ -1047,7 +1047,7 @@ static void sigterm_handler(int signal) unload_plugins(); #endif - if (logfile != NULL && logfile != stdout) { + if (logfile != NULL && logfile != stdout && logfile != &syslog_dummy) { fclose(logfile); logfile = NULL; } @@ -1228,7 +1228,7 @@ int main(int argc, char* argv[]) if (fork()) { exit(0); } - if (logfile != stdout && logfile != &syslog_dummy) + if (logfile != stdout) fclose(stdout); fclose(stderr); fclose(stdin); -- cgit v1.2.3