]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl/parseconfig: use curl_free() to free memory allocated by libcurl
authorDaniel Stenberg <daniel@haxx.se>
Wed, 18 Dec 2019 12:43:50 +0000 (13:43 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 18 Dec 2019 13:48:41 +0000 (14:48 +0100)
Reported-by: bxac on github
Fixes #4730
Closes #4731

src/tool_parsecfg.c

index 208897f48c1ca047a4337e30904cd5d0475e5fa9..a9057ea317f7f810b216c6f6a7da1fdc32a6c022 100644 (file)
@@ -98,7 +98,7 @@ int parseconfig(const char *filename, struct GlobalConfig *global)
       char prefix = '.';
       do {
         /* if it was allocated in a previous attempt */
-        free(pathalloc);
+        curl_free(pathalloc);
         /* check for .curlrc then _curlrc in the home dir */
         pathalloc = curl_maprintf("%s%s%ccurlrc", home, DIR_CHAR, prefix);
         if(!pathalloc) {
@@ -287,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;
 }