From: x2018 Date: Thu, 28 Oct 2021 11:55:46 +0000 (+0800) Subject: url: check the return value of curl_url() X-Git-Tag: curl-7_80_0~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d55b8b6a45b20898cf3c0ea621c32bc296c67383;p=thirdparty%2Fcurl.git url: check the return value of curl_url() Closes #7917 --- diff --git a/lib/url.c b/lib/url.c index f79fd4ea10..93b4397bff 100644 --- a/lib/url.c +++ b/lib/url.c @@ -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,