← Commit list

2754e0f3d3

Daniel Stenberg
Daniel Stenberg
2025-12-29
SUCCESS Duration: 265s

Subject

url: return error at once when OOM in netrc handling

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/url.c+4 -2
@@ -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] ?