From 6023de67c84e531939b77454783835c65f694bff Mon Sep 17 00:00:00 2001 From: "/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org" Date: Mon, 7 Jan 2008 16:32:10 +0000 Subject: fix segfaul in the exit path for the statistics mode (introduced in r7175) --- src/stats-mode.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/stats-mode.c') diff --git a/src/stats-mode.c b/src/stats-mode.c index 05a1b2c..ee9b3fd 100644 --- a/src/stats-mode.c +++ b/src/stats-mode.c @@ -60,9 +60,11 @@ static int init_stats(void) static void kill_stats() { cache_destroy(STATE_STATS(cache)); - buffer_flush(STATE_STATS(buffer_log), - dlog_buffered_ct_flush, - STATE(stats_log)); + /* flush the buffer before exiting */ + if (STATE(stats_log) != NULL) + buffer_flush(STATE(stats_log), + dlog_buffered_ct_flush, + STATE(stats_log)); } /* handler for requests coming via UNIX socket */ -- cgit v1.2.3