Permalink
Browse files

Either store the Resolver in DNS::AddResolverClass() or delete it bef…

…ore returning
  • Loading branch information...
attilamolnar committed Mar 2, 2013
1 parent 99a470a commit 2bdbb2878efb600af81513147983aeac7bd62331
Showing with 5 additions and 12 deletions.
  1. +5 −12 src/dns.cpp
View
@@ -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)

0 comments on commit 2bdbb28

Please sign in to comment.