]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_operhlp: fix "potentially uninitialized local variable 'pc' used"
authorTal Regev <tal.regev@gmail.com>
Sun, 4 Aug 2024 22:03:09 +0000 (01:03 +0300)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 5 Aug 2024 06:21:49 +0000 (08:21 +0200)
A false positive by MSVC.

Closes #14389

src/tool_operhlp.c

index 8d356d9e4aae7682120fc9ec13f930e9b3329375..be5bc0a260e2a704fbe9d7d1dd529be974568a8c 100644 (file)
@@ -182,7 +182,6 @@ fail:
  */
 CURLcode get_url_file_name(char **filename, const char *url)
 {
-  char *pc, *pc2;
   CURLU *uh = curl_url();
   char *path = NULL;
   CURLUcode uerr;
@@ -199,7 +198,7 @@ CURLcode get_url_file_name(char **filename, const char *url)
     uh = NULL;
     if(!uerr) {
       int i;
-
+      char *pc = NULL, *pc2 = NULL;
       for(i = 0; i < 2; i++) {
         pc = strrchr(path, '/');
         pc2 = strrchr(pc ? pc + 1 : path, '\\');