1
0
mirror of https://github.com/anope/anope.git synced 2026-07-03 21:23:13 +02:00

Fixed a crash in the DNS engine when using cached results

This commit is contained in:
Adam
2010-11-09 03:20:50 -05:00
parent dc1252597a
commit fe6d7913ce
+4 -1
View File
@@ -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)
{