From 2ce308f09f89127313c343c0a0178d665232398f Mon Sep 17 00:00:00 2001 From: Shivani Bhardwaj Date: Tue, 22 Jun 2021 00:05:06 +0530 Subject: [PATCH] counters: only print alerts if stats are enabled (cherry picked from commit a17da8374a905ad31a4fa66f85ee1cc73b857389) --- src/counters.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/counters.c b/src/counters.c index b1c64f2cd9..2d9fabeca9 100644 --- a/src/counters.c +++ b/src/counters.c @@ -838,6 +838,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) {