commit a2b0a291a60f2f59357097c21008b9c716c2a6bc
parent c6b646b004e5d62361525f9eb9c5d19ad9624f24
Author: Frederic Cambus <fred@statdns.com>
Date: Mon, 15 Feb 2021 13:59:27 +0100
Only call MMDB_close if the GeoIP option was enabled.
This fixes a crash on program exit on OpenBSD when running without
the GeoIP option enabled.
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/logswan.c b/src/logswan.c
@@ -315,7 +315,8 @@ main(int argc, char *argv[])
/* Clean up */
fclose(logfile);
- MMDB_close(&geoip2);
+ if (geoip)
+ MMDB_close(&geoip2);
hll_destroy(&unique_ipv4);
hll_destroy(&unique_ipv6);