aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-07-04 00:58:39 +0200
committerDaniel Stenberg <daniel@haxx.se>2018-07-11 23:41:24 +0200
commitc8373e3dfc324e51f2221fefc4edff69d00f933c (patch)
tree0eb346fe1610b6b7ac30d5182e09f92688dd37ab /lib
parent1b76c38904f0033ac1403ec4b31c28f23805c0d4 (diff)
ares: check for NULL in completed-callback
Diffstat (limited to 'lib')
-rw-r--r--lib/asyn-ares.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/asyn-ares.c b/lib/asyn-ares.c
index 00fe1adb5..5cfb2602d 100644
--- a/lib/asyn-ares.c
+++ b/lib/asyn-ares.c
@@ -475,17 +475,19 @@ static void query_completed_cb(void *arg, /* (struct connectdata *) */
return;
res = (struct ResolverResults *)conn->async.os_specific;
- res->num_pending--;
+ if(res) {
+ res->num_pending--;
- if(CURL_ASYNC_SUCCESS == status) {
- Curl_addrinfo *ai = Curl_he2ai(hostent, conn->async.port);
- if(ai) {
- compound_results(res, ai);
+ if(CURL_ASYNC_SUCCESS == status) {
+ Curl_addrinfo *ai = Curl_he2ai(hostent, conn->async.port);
+ if(ai) {
+ compound_results(res, ai);
+ }
}
+ /* A successful result overwrites any previous error */
+ if(res->last_status != ARES_SUCCESS)
+ res->last_status = status;
}
- /* A successful result overwrites any previous error */
- if(res->last_status != ARES_SUCCESS)
- res->last_status = status;
}
/*