aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2017-10-07 17:54:41 +0200
committerDaniel Stenberg <daniel@haxx.se>2017-10-07 17:54:41 +0200
commitf3e03f6c0ac52a1bf396e03f7d7e9b5b3b7165fe (patch)
tree374894a4608b533321bbd5c3f2861db9351f143e
parent5b54df06d2cec422d5f237e0fa0212be0303edce (diff)
multi_done: wait for name resolve to finish if still ongoing
... as we must clean up memory.
-rw-r--r--lib/multi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/multi.c b/lib/multi.c
index faf42f1fa..ec679ba4a 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -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 */