bail out nicely if strdup() returns NULL, removed trailing whitespace

This commit is contained in:
Daniel Stenberg 2004-05-17 06:53:41 +00:00
parent 6bd8db3c99
commit de279099e5

View File

@ -334,12 +334,16 @@ CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles)
easy->result = Curl_done(easy->easy_conn, CURLE_OK);
if(CURLE_OK == easy->result) {
gotourl = strdup(easy->easy_handle->change.url);
easy->easy_handle->change.url_changed = FALSE;
easy->result = Curl_follow(easy->easy_handle, gotourl);
if(CURLE_OK == easy->result)
easy->state = CURLM_STATE_CONNECT;
if(gotourl) {
easy->easy_handle->change.url_changed = FALSE;
easy->result = Curl_follow(easy->easy_handle, gotourl);
if(CURLE_OK == easy->result)
easy->state = CURLM_STATE_CONNECT;
else
free(gotourl);
}
else
free(gotourl);
easy->result = CURLE_OUT_OF_MEMORY;
}
}