When this callback is called due to the destruction of the ares handle,
the connection pointer passed in as an argument may no longer pointing
to valid data and this function doesn't need to do anything with it
anyway so we make sure it doesn't.
Bug: http://curl.haxx.se/mail/lib-2011-01/0333.html
Reported by: Vsevolod Novikov
(void)timeouts; /* ignored */
#endif
- if (status == CURL_ASYNC_SUCCESS) {
+ switch(status) {
+ case CURL_ASYNC_SUCCESS:
ai = Curl_he2ai(hostent, conn->async.port);
+ break;
+ case ARES_EDESTRUCTION:
+ /* this ares handle is getting destroyed, the 'arg' pointer may not be
+ valid! */
+ return;
+ default:
+ /* do nothing */
+ break;
}
(void)Curl_addrinfo_callback(arg, status, ai);