summaryrefslogtreecommitdiff
path: root/src/tool_parsecfg.c
diff options
context:
space:
mode:
authorAlessandro Ghedini <ghedo@debian.org>2020-02-09 13:08:33 +0000
committerAlessandro Ghedini <ghedo@debian.org>2020-02-09 13:08:33 +0000
commitfd1d5a17d8860d992d5022826b86898e22847bfb (patch)
treee6734b853d299aa98a3653cebf0233a712c07009 /src/tool_parsecfg.c
parentcbefed98f8c0f58b41921fcde1aa741078e803d7 (diff)
New upstream version 7.68.0
Diffstat (limited to 'src/tool_parsecfg.c')
-rw-r--r--src/tool_parsecfg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tool_parsecfg.c b/src/tool_parsecfg.c
index 9b32e54a..a9057ea3 100644
--- a/src/tool_parsecfg.c
+++ b/src/tool_parsecfg.c
@@ -97,6 +97,8 @@ int parseconfig(const char *filename, struct GlobalConfig *global)
int i = 0;
char prefix = '.';
do {
+ /* if it was allocated in a previous attempt */
+ curl_free(pathalloc);
/* check for .curlrc then _curlrc in the home dir */
pathalloc = curl_maprintf("%s%s%ccurlrc", home, DIR_CHAR, prefix);
if(!pathalloc) {
@@ -285,7 +287,7 @@ int parseconfig(const char *filename, struct GlobalConfig *global)
else
rc = 1; /* couldn't open the file */
- free(pathalloc);
+ curl_free(pathalloc);
return rc;
}