]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
stats: fix unix socket crash
authorVictor Julien <victor@inliniac.net>
Wed, 16 Mar 2016 11:20:17 +0000 (12:20 +0100)
committerVictor Julien <victor@inliniac.net>
Wed, 16 Mar 2016 11:20:17 +0000 (12:20 +0100)
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.

src/counters.c

index 18f1093b393922541df1745253dd38060d92bc2a..325442f2d6e9a7a3a9a7a94447da28ee2f64e4db 100644 (file)
@@ -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);