From: Daniel Stenberg Date: Sat, 27 Dec 2025 16:06:31 +0000 (+0100) Subject: url: return error at once when OOM in netrc handling X-Git-Tag: curl-8_18_0~79 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2754e0f3d32f440e96705280090b7afea294a237;p=thirdparty%2Fcurl.git url: return error at once when OOM in netrc handling Closes #20103 --- diff --git a/lib/url.c b/lib/url.c index f64a1a481c..130be1952c 100644 --- a/lib/url.c +++ b/lib/url.c @@ -2695,8 +2695,10 @@ static CURLcode override_login(struct Curl_easy *data, NETRCcode ret = Curl_parsenetrc(&data->state.netrc, conn->host.name, userp, passwdp, data->set.str[STRING_NETRC_FILE]); - if(ret && ((ret == NETRC_NO_MATCH) || - (data->set.use_netrc == CURL_NETRC_OPTIONAL))) { + if(ret == NETRC_OUT_OF_MEMORY) + return CURLE_OUT_OF_MEMORY; + else if(ret && ((ret == NETRC_NO_MATCH) || + (data->set.use_netrc == CURL_NETRC_OPTIONAL))) { infof(data, "Could not find host %s in the %s file; using defaults", conn->host.name, (data->set.str[STRING_NETRC_FILE] ?