url: check the return value of curl_url()

Closes #7917
This commit is contained in:
x2018 2021-10-28 19:55:46 +08:00 committed by Daniel Stenberg
parent 6fe4e7d3bf
commit d55b8b6a45
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -2397,6 +2397,11 @@ static CURLcode parse_proxy(struct Curl_easy *data,
CURLcode result = CURLE_OK;
char *scheme = NULL;
if(!uhp) {
result = CURLE_OUT_OF_MEMORY;
goto error;
}
/* When parsing the proxy, allowing non-supported schemes since we have
these made up ones for proxies. Guess scheme for URLs without it. */
uc = curl_url_set(uhp, CURLUPART_URL, proxy,