check malloc() return code

This commit is contained in:
Daniel Stenberg 2004-05-04 13:39:24 +00:00
parent 9e31a0536e
commit 08d1da106e
1 changed files with 16 additions and 13 deletions

View File

@ -1430,7 +1430,7 @@ CURLcode Curl_http(struct connectdata *conn)
char *newurl;
newurl = malloc(urllen + newlen - currlen + 1);
if(newurl) {
/* copy the part before the host name */
memcpy(newurl, url, ptr - url);
/* append the new host name instead of the old */
@ -1444,6 +1444,9 @@ CURLcode Curl_http(struct connectdata *conn)
data->change.url = newurl;
data->change.url_alloc = TRUE;
}
else
return CURLE_OUT_OF_MEMORY;
}
}
ppath = data->change.url;
}