summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2013-03-02 21:45:14 +0100
committerattilamolnar <attilamolnar@hush.com>2013-03-11 20:48:58 +0100
commit2bdbb2878efb600af81513147983aeac7bd62331 (patch)
tree0a5f55a60287c6a7b1efd16c1a39a8f09745936e
parent99a470a5909b05757dbaef96cce1fafdba7d5240 (diff)
Either store the Resolver in DNS::AddResolverClass() or delete it before returning
-rw-r--r--src/dns.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/dns.cpp b/src/dns.cpp
index ced8b637f..aa340a1de 100644
--- a/src/dns.cpp
+++ b/src/dns.cpp
@@ -1068,20 +1068,13 @@ bool DNS::AddResolverClass(Resolver* r)
Classes[r->GetId()] = r;
return true;
}
- else
- /* Duplicate id */
- return false;
}
- else
- {
- /* Pointer or id not valid.
- * Free the item and return
- */
- if (r)
- delete r;
- return false;
- }
+ /* Pointer or id not valid, or duplicate id.
+ * Free the item and return
+ */
+ delete r;
+ return false;
}
void DNS::CleanResolvers(Module* module)