From e180dde9c578d8a737a24a00f1d52355a53d55fe Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 7 Jan 2022 16:06:58 +0100 Subject: [PATCH] tool_findfile: free mem properly Follow-up to 764e4f066d5 Closes #8242 --- src/tool_findfile.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tool_findfile.c b/src/tool_findfile.c index 766586f695..f2ab09d0ea 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 */ }