gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnurl] 05/153: ares: check for NULL in completed-callback


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 05/153: ares: check for NULL in completed-callback
Date: Tue, 11 Sep 2018 12:51:16 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository gnurl.

commit c8373e3dfc324e51f2221fefc4edff69d00f933c
Author: Daniel Stenberg <address@hidden>
AuthorDate: Wed Jul 4 00:58:39 2018 +0200

    ares: check for NULL in completed-callback
---
 lib/asyn-ares.c | 18 ++++++++++--------
 1 file 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;
 }
 
 /*

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]