From: Shivani Bhardwaj Date: Mon, 21 Jun 2021 18:35:06 +0000 (+0530) Subject: counters: only print alerts if stats are enabled X-Git-Tag: suricata-5.0.8~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3166437fda8b177039324b2ddb7cff91c09a1985;p=thirdparty%2Fsuricata.git counters: only print alerts if stats are enabled (cherry picked from commit a17da8374a905ad31a4fa66f85ee1cc73b857389) --- diff --git a/src/counters.c b/src/counters.c index 7952a12dfd..fbf8a009d3 100644 --- a/src/counters.c +++ b/src/counters.c @@ -837,6 +837,9 @@ TmEcode StatsOutputCounterSocket(json_t *cmd, static void StatsLogSummary(void) { + if (!stats_enabled) { + return; + } uint64_t alerts = 0; SCMutexLock(&stats_table_mutex); if (stats_table.start_time != 0) {