Skip to content

Commit 44bf298

Browse files
committed
Avoids to cleanup GeoIp on ModSecurity destructor
GeoIp is already being cleaned elsewhere. Fix #2041
1 parent a6fe74d commit 44bf298

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

‎CHANGES‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
v3.x.y - YYYY-MMM-DD (to be released)
22
-------------------------------------
33

4+
- Avoids to cleanup GeoIp on ModSecurity destructor
5+
[#2041 - @zimmerle, @jptosso, @victorhora]
46
- Fix memory leak of RuleMessages objects
57
[#2376 - @WGH-, @martinhsv]
68
- Produce not-supported error for ctl:forceRequestBodyVariable

‎src/modsecurity.cc‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,6 @@ ModSecurity::~ModSecurity() {
9595
#ifdef MSC_WITH_CURL
9696
curl_global_cleanup();
9797
#endif
98-
#ifdef WITH_GEOIP
99-
Utils::GeoLookup::getInstance().cleanUp();
100-
#endif
10198
#ifdef WITH_LIBXML2
10299
xmlCleanupParser();
103100
#endif

‎src/utils/geo_lookup.h‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,16 @@ class GeoLookup {
5555
private:
5656
GeoLookup() :
5757
m_version(NOT_LOADED)
58+
#if WITH_MAXMIND
59+
,mmdb()
60+
#endif
5861
#if WITH_GEOIP
5962
,m_gi(NULL)
6063
#endif
6164
{ }
6265
~GeoLookup();
63-
GeoLookup(GeoLookup const&);
64-
void operator=(GeoLookup const&);
66+
GeoLookup(GeoLookup const&) = delete;
67+
void operator=(GeoLookup const&) = delete;
6568

6669
GeoLookupVersion m_version;
6770
#if WITH_MAXMIND

‎test/cppcheck_suppressions.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ functionStatic:src/engine/lua.h:80
5151
functionConst:src/utils/geo_lookup.h:49
5252
useInitializationList:src/operators/rbl.h:69
5353
constStatement:test/common/modsecurity_test.cc:82
54-
danglingTemporaryLifetime:src/modsecurity.cc:204
54+
danglingTemporaryLifetime:src/modsecurity.cc:201
5555
functionStatic:src/operators/geo_lookup.h:35
5656
duplicateBreak:src/operators/validate_utf8_encoding.cc
5757
duplicateBranch:src/request_body_processor/multipart.cc:91
5858
syntaxError:src/transaction.cc:62
5959
noConstructor:src/variables/variable.h:152
6060
duplicateBranch:src/request_body_processor/multipart.cc:93
61-
danglingTempReference:src/modsecurity.cc:204
61+
danglingTempReference:src/modsecurity.cc:201
6262
knownConditionTrueFalse:src/operators/validate_url_encoding.cc:79
6363
knownConditionTrueFalse:src/operators/verify_svnr.cc:90
6464
noConstructor:src/actions/rule_id.h:30

0 commit comments

Comments
 (0)