summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorx2018 <xkernel.wang@foxmail.com>2021-10-28 19:55:46 +0800
committerDaniel Stenberg <daniel@haxx.se>2021-10-28 15:22:19 +0200
commitd55b8b6a45b20898cf3c0ea621c32bc296c67383 (patch)
treefd1399611a20fd491cfbf10f8ef097a255c9a5c4
parent6fe4e7d3bfc1520da032ea067b4712cc1357f016 (diff)
downloadcurl-d55b8b6a45b20898cf3c0ea621c32bc296c67383.tar.gz
url: check the return value of curl_url()
Closes #7917
-rw-r--r--lib/url.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/url.c b/lib/url.c
index f79fd4ea1..93b4397bf 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,