Fix lookup_hostname BIF (and memory leak in it).

The problem was caused by uninitialized is_text member in AsyncRequest.
This commit is contained in:
Jon Siwek 2012-11-08 12:00:22 -06:00
parent dae9c946b6
commit 89500c9176
2 changed files with 2 additions and 1 deletions

View file

@ -1012,7 +1012,6 @@ void DNS_Mgr::AsyncLookupAddr(const IPAddr& host, LookupCallback* callback)
// A new one. // A new one.
req = new AsyncRequest; req = new AsyncRequest;
req->host = host; req->host = host;
req->is_txt = false;
asyncs_queued.push_back(req); asyncs_queued.push_back(req);
asyncs_addrs.insert(AsyncRequestAddrMap::value_type(host, req)); asyncs_addrs.insert(AsyncRequestAddrMap::value_type(host, req));
} }

View file

@ -174,6 +174,8 @@ protected:
bool is_txt; bool is_txt;
CallbackList callbacks; CallbackList callbacks;
AsyncRequest() : time(0.0), is_txt(false) { }
bool IsAddrReq() const { return name.length() == 0; } bool IsAddrReq() const { return name.length() == 0; }
void Resolved(const char* name) void Resolved(const char* name)