]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
urlapi.c:seturl: assert URL instead of using if-check
authorDaniel Stenberg <daniel@haxx.se>
Sun, 22 Aug 2021 22:34:16 +0000 (00:34 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 23 Aug 2021 06:50:58 +0000 (08:50 +0200)
There's no code flow possible where this can happen. The assert makes
sure it also won't be introduced undetected in the future.

Closes #7610

lib/urlapi.c

index 905c499d995829dbdf3d1ae91db248a42dd77130..7f03862cfa219258e0cbc7b47af65bd46c22fdd1 100644 (file)
@@ -770,8 +770,7 @@ static CURLUcode seturl(const char *url, CURLU *u, unsigned int flags)
   size_t schemelen = 0;
   size_t urllen;
 
-  if(!url)
-    return CURLUE_MALFORMED_INPUT;
+  DEBUGASSERT(url);
 
   /*************************************************************
    * Parse the URL.