From: Victor Julien Date: Wed, 16 Mar 2016 11:20:17 +0000 (+0100) Subject: stats: fix unix socket crash X-Git-Tag: suricata-3.0.1RC1~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a70ff19911b2be650c1b115eae7681480851f2e9;p=thirdparty%2Fsuricata.git stats: fix unix socket crash Reset counters_global_id at ctx destruction. In the unix socket runmode the lack of this reset would cause the id's to increase with each pcap, leading to an ever larger stats array. --- diff --git a/src/counters.c b/src/counters.c index 18f1093b39..325442f2d6 100644 --- a/src/counters.c +++ b/src/counters.c @@ -288,6 +288,7 @@ static void StatsReleaseCtx() if (stats_ctx->counters_id_hash != NULL) { HashTableFree(stats_ctx->counters_id_hash); stats_ctx->counters_id_hash = NULL; + counters_global_id = 0; } StatsPublicThreadContextCleanup(&stats_ctx->global_counter_ctx);