summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2013-05-18 16:04:10 +0200
committerattilamolnar <attilamolnar@hush.com>2013-05-18 16:04:10 +0200
commitb92f3e2032357e5e2aed9814ef169c6560787da7 (patch)
treeb48dd4c1812eaf5c120b3a840e8a7431aa4cf292 /src
parent67822c67e91e70917ddbdec0bd8453c7170ee06d (diff)
m_geoip Set cc in OnSetConnectClass to the newly created string if it was NULL
Diffstat (limited to 'src')
-rw-r--r--src/modules/extra/m_geoip.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/modules/extra/m_geoip.cpp b/src/modules/extra/m_geoip.cpp
index c93479b3c..a36c39bc8 100644
--- a/src/modules/extra/m_geoip.cpp
+++ b/src/modules/extra/m_geoip.cpp
@@ -35,7 +35,7 @@ class ModuleGeoIP : public Module
LocalStringExt ext;
GeoIP* gi;
- void SetExt(LocalUser* user)
+ std::string* SetExt(LocalUser* user)
{
const char* c = GeoIP_country_code_by_addr(gi, user->GetIPString());
if (!c)
@@ -43,6 +43,7 @@ class ModuleGeoIP : public Module
std::string* cc = new std::string(c);
ext.set(user, cc);
+ return cc;
}
public:
@@ -85,7 +86,7 @@ class ModuleGeoIP : public Module
{
std::string* cc = ext.get(user);
if (!cc)
- SetExt(user);
+ cc = SetExt(user);
std::string geoip = myclass->config->getString("geoip");
if (geoip.empty())