]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
url: check the return value of curl_url()
authorx2018 <xkernel.wang@foxmail.com>
Thu, 28 Oct 2021 11:55:46 +0000 (19:55 +0800)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 28 Oct 2021 13:22:19 +0000 (15:22 +0200)
Closes #7917

lib/url.c

index f79fd4ea10933a37b1a0c508aadaee001a3d44cc..93b4397bff9802fc390532fe81c51535512e221c 100644 (file)
--- 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,