http: fix OOM exit in Curl_http_follow

Spotted by "strict torture" tests.

Closes #19705
This commit is contained in:
Daniel Stenberg 2025-11-26 11:01:09 +01:00
parent cb722b32ad
commit 0d2bb9c7c6
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -1282,7 +1282,7 @@ CURLcode Curl_http_follow(struct Curl_easy *data, const char *newurl,
CURLU_ALLOW_SPACE |
(data->set.path_as_is ? CURLU_PATH_AS_IS : 0)));
if(uc) {
if(type != FOLLOW_FAKE) {
if((uc == CURLUE_OUT_OF_MEMORY) || (type != FOLLOW_FAKE)) {
failf(data, "The redirect target URL could not be parsed: %s",
curl_url_strerror(uc));
return Curl_uc_to_curlcode(uc);