From 7e66c7050711f0fe423b3ef7399a3526e9ae99fb Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 27 May 2015 14:11:57 +0200 Subject: [PATCH] counters: don't run if no counters have been registered --- src/counters.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/counters.c b/src/counters.c index 08f6329a29..7fa1045d22 100644 --- a/src/counters.c +++ b/src/counters.c @@ -591,6 +591,9 @@ static int StatsOutput(ThreadVars *tv) const StatsCounter *pc = NULL; void *td = stats_thread_data; + if (counters_global_id == 0) + return -1; + if (stats_table.nstats == 0) { StatsThreadRegister("Global", &stats_ctx->global_counter_ctx);