url: fix return code for OOM in parse_proxy()

Closes #19779
This commit is contained in:
Daniel Stenberg 2025-12-01 09:26:28 +01:00
parent 41931f1659
commit cffc912844
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -2250,11 +2250,15 @@ static CURLcode parse_proxy(struct Curl_easy *data,
/* Is there a username and password given in this proxy url? */
uc = curl_url_get(uhp, CURLUPART_USER, &proxyuser, CURLU_URLDECODE);
if(uc && (uc != CURLUE_NO_USER))
if(uc && (uc != CURLUE_NO_USER)) {
result = Curl_uc_to_curlcode(uc);
goto error;
}
uc = curl_url_get(uhp, CURLUPART_PASSWORD, &proxypasswd, CURLU_URLDECODE);
if(uc && (uc != CURLUE_NO_PASSWORD))
if(uc && (uc != CURLUE_NO_PASSWORD)) {
result = Curl_uc_to_curlcode(uc);
goto error;
}
if(proxyuser || proxypasswd) {
curlx_free(proxyinfo->user);