summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2016-07-06 20:52:43 +0200
committerMattes D <github@xoft.cz>2016-08-13 21:16:21 +0200
commitdd5567a90c47e52b19bacae5eddce88b5c3d4cd6 (patch)
tree68f7279d31a2147962db6b26cab6554ac262a198
parentConverted cLuaState::cTableRef to use cTrackedRef. (diff)
downloadcuberite-dd5567a90c47e52b19bacae5eddce88b5c3d4cd6.tar
cuberite-dd5567a90c47e52b19bacae5eddce88b5c3d4cd6.tar.gz
cuberite-dd5567a90c47e52b19bacae5eddce88b5c3d4cd6.tar.bz2
cuberite-dd5567a90c47e52b19bacae5eddce88b5c3d4cd6.tar.lz
cuberite-dd5567a90c47e52b19bacae5eddce88b5c3d4cd6.tar.xz
cuberite-dd5567a90c47e52b19bacae5eddce88b5c3d4cd6.tar.zst
cuberite-dd5567a90c47e52b19bacae5eddce88b5c3d4cd6.zip
-rw-r--r--src/OSSupport/IPLookup.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/OSSupport/IPLookup.cpp b/src/OSSupport/IPLookup.cpp
index 8cdc5132d..2722d4722 100644
--- a/src/OSSupport/IPLookup.cpp
+++ b/src/OSSupport/IPLookup.cpp
@@ -103,7 +103,13 @@ bool cNetwork::IPToHostName(
{
auto res = std::make_shared<cIPLookup>(a_Callbacks);
cNetworkSingleton::Get().AddIPLookup(res);
- return res->Lookup(a_IP);
+ if (!res->Lookup(a_IP))
+ {
+ // Lookup failed early on, remove the object completely:
+ cNetworkSingleton::Get().RemoveIPLookup(res.get());
+ return false;
+ }
+ return true;
}