From 8b87801b80f16d4b24c419221b49e43370ff6932 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 21 Jun 2019 21:40:20 +0200 Subject: [PATCH] geoip: fix unittests w/o db present --- src/detect-geoip.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/detect-geoip.c b/src/detect-geoip.c index 0558b2a5f1..d1710b2118 100644 --- a/src/detect-geoip.c +++ b/src/detect-geoip.c @@ -373,9 +373,12 @@ static DetectGeoipData *DetectGeoipDataParse (const char *str) SCLogDebug("negated geoip"); } - /* Initialize the geolocation engine */ - if (InitGeolocationEngine(geoipdata) == false) - goto error; + /* init geo engine, but not when running as unittests */ + if (!(RunmodeIsUnittests())) { + /* Initialize the geolocation engine */ + if (InitGeolocationEngine(geoipdata) == false) + goto error; + } return geoipdata;