]> granicus.if.org Git - curl/commitdiff
multi_done: wait for name resolve to finish if still ongoing
authorDaniel Stenberg <daniel@haxx.se>
Sat, 7 Oct 2017 15:54:41 +0000 (17:54 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 7 Oct 2017 15:54:41 +0000 (17:54 +0200)
... as we must clean up memory.

lib/multi.c

index faf42f1fa2a03caf9c961b6fd584ff6a2d5e428a..ec679ba4a0ff41613ea71768a5fbfcab55e1de71 100644 (file)
@@ -537,6 +537,12 @@ static CURLcode multi_done(struct connectdata **connp,
     /* Stop if multi_done() has already been called */
     return CURLE_OK;
 
+  if(data->mstate == CURLM_STATE_WAITRESOLVE) {
+    /* done while still waiting for the resolve to complete */
+    struct Curl_dns_entry *throw_away;
+    (void)Curl_resolver_wait_resolv(conn, &throw_away);
+  }
+
   Curl_getoff_all_pipelines(data, conn);
 
   /* Cleanup possible redirect junk */