summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2022-01-07 16:06:58 +0100
committerDaniel Stenberg <daniel@haxx.se>2022-01-07 16:39:19 +0100
commite180dde9c578d8a737a24a00f1d52355a53d55fe (patch)
treed5f7fdf5d87e1c3e26db78107fc8bbaf4b153ec5
parent764e4f066d5719e68fa0d6b0b0d9efa0625c5c15 (diff)
downloadcurl-e180dde9c578d8a737a24a00f1d52355a53d55fe.tar.gz
tool_findfile: free mem properly
Follow-up to 764e4f066d5 Closes #8242
-rw-r--r--src/tool_findfile.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tool_findfile.c b/src/tool_findfile.c
index 766586f69..f2ab09d0e 100644
--- a/src/tool_findfile.c
+++ b/src/tool_findfile.c
@@ -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 */
}