From 2bdbb2878efb600af81513147983aeac7bd62331 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Sat, 2 Mar 2013 21:45:14 +0100 Subject: Either store the Resolver in DNS::AddResolverClass() or delete it before returning --- src/dns.cpp | 17 +++++------------ 1 file 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) -- cgit v1.2.3