From: Salih Gonullu Date: Sat, 26 Mar 2011 20:51:28 +0000 (+0100) Subject: ulogd: fix segfault if syslog and SIGTERM is received X-Git-Tag: ulogd-2.0.0~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c8fb552eeabd1a7cd9440d55c96918c0aa1ae3a9;p=thirdparty%2Fulogd2.git ulogd: fix segfault if syslog and SIGTERM is received Signed-off-by: Pablo Neira Ayuso --- 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);