From: Victor Julien Date: Fri, 21 Jun 2019 19:40:20 +0000 (+0200) Subject: geoip: fix unittests w/o db present X-Git-Tag: suricata-5.0.0-rc1~219 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b87801b80f16d4b24c419221b49e43370ff6932;p=thirdparty%2Fsuricata.git geoip: fix unittests w/o db present --- 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;