summaryrefslogtreecommitdiffstats
path: root/src/OSSupport/IPLookup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/OSSupport/IPLookup.cpp')
-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;
}