bail out nicely if strdup() returns NULL, removed trailing whitespace
This commit is contained in:
parent
6bd8db3c99
commit
de279099e5
14
lib/multi.c
14
lib/multi.c
@ -334,12 +334,16 @@ CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles)
|
|||||||
easy->result = Curl_done(easy->easy_conn, CURLE_OK);
|
easy->result = Curl_done(easy->easy_conn, CURLE_OK);
|
||||||
if(CURLE_OK == easy->result) {
|
if(CURLE_OK == easy->result) {
|
||||||
gotourl = strdup(easy->easy_handle->change.url);
|
gotourl = strdup(easy->easy_handle->change.url);
|
||||||
easy->easy_handle->change.url_changed = FALSE;
|
if(gotourl) {
|
||||||
easy->result = Curl_follow(easy->easy_handle, gotourl);
|
easy->easy_handle->change.url_changed = FALSE;
|
||||||
if(CURLE_OK == easy->result)
|
easy->result = Curl_follow(easy->easy_handle, gotourl);
|
||||||
easy->state = CURLM_STATE_CONNECT;
|
if(CURLE_OK == easy->result)
|
||||||
|
easy->state = CURLM_STATE_CONNECT;
|
||||||
|
else
|
||||||
|
free(gotourl);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
free(gotourl);
|
easy->result = CURLE_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user