From ed19c80a261ba193cf9dd5b2a3f7d7f9593e382e Mon Sep 17 00:00:00 2001 From: Frederic Cambus Date: Tue, 16 Nov 2021 12:28:57 +0100 Subject: [PATCH] Call hll_init() after doing getopt() processing. This appeases LSan when exiting before doing any processing. --- src/logswan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/logswan.c b/src/logswan.c index 22384d7..b9814f3 100644 --- a/src/logswan.c +++ b/src/logswan.c @@ -104,9 +104,6 @@ main(int argc, char *argv[]) } #endif - hll_init(&unique_ipv4, HLL_BITS); - hll_init(&unique_ipv6, HLL_BITS); - while ((opt = getopt(argc, argv, "d:ghv")) != -1) { switch (opt) { case 'd': @@ -134,6 +131,9 @@ main(int argc, char *argv[]) return EXIT_SUCCESS; } + hll_init(&unique_ipv4, HLL_BITS); + hll_init(&unique_ipv6, HLL_BITS); + /* Starting timer */ clock_gettime(CLOCK_MONOTONIC, &begin);