summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dns.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/dns.cpp b/src/dns.cpp
index adedf9e61..0ccd5d9dd 100644
--- a/src/dns.cpp
+++ b/src/dns.cpp
@@ -7,7 +7,7 @@ static inline unsigned short GetRandomID()
return rand();
}
-DNSRequest::DNSRequest(const Anope::string &addr, QueryType qt, bool cache, Module *c) : creator(c), address(addr), QT(qt)
+DNSRequest::DNSRequest(const Anope::string &addr, QueryType qt, bool cache, Module *c) : timeout(NULL), id(0), creator(c), address(addr), QT(qt)
{
if (!DNSEngine)
DNSEngine = new DNSManager();
@@ -52,6 +52,9 @@ DNSRequest::DNSRequest(const Anope::string &addr, QueryType qt, bool cache, Modu
DNSRequest::~DNSRequest()
{
+ /* We never got a chance to fire off a query or create a timer */
+ if (!this->timeout)
+ return;
/* DNSRequest came back, delete the timeout */
if (!this->timeout->done)
{