easy: fix dangling pointer on easy_perform fail

Closes https://github.com/curl/curl/pull/5363
This commit is contained in:
denzor 2020-05-09 17:52:47 +03:00 committed by Jay Satiro
parent b995bb58cb
commit a9021716cc
1 changed files with 1 additions and 0 deletions

View File

@ -681,6 +681,7 @@ static CURLcode easy_perform(struct Curl_easy *data, bool events)
mcode = curl_multi_add_handle(multi, data);
if(mcode) {
curl_multi_cleanup(multi);
data->multi_easy = NULL;
if(mcode == CURLM_OUT_OF_MEMORY)
return CURLE_OUT_OF_MEMORY;
return CURLE_FAILED_INIT;