]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_findfile: free mem properly
authorDaniel Stenberg <daniel@haxx.se>
Fri, 7 Jan 2022 15:06:58 +0000 (16:06 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 7 Jan 2022 15:39:19 +0000 (16:39 +0100)
Follow-up to 764e4f066d5

Closes #8242

src/tool_findfile.c

index 766586f695110300427c84f573805a2bb800bc90..f2ab09d0ea33f581dfec6caefec56e039c68ece2 100644 (file)
@@ -126,10 +126,12 @@ char *findfile(const char *fname, int dotscore)
         home = c;
       }
       if(list[i].withoutdot) {
-        if(!dotscore || xdg)
+        if(!dotscore || xdg) {
           /* this is not looking for .curlrc, or the XDG_CONFIG_HOME was
              defined so we skip the extended check */
+          curl_free(home);
           continue;
+        }
         filename++; /* move past the leading dot */
         dotscore = 0; /* disable it for this check */
       }