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:
+4
-1
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user