mirror of
https://github.com/curl/curl.git
synced 2024-11-21 01:16:58 +08:00
curl/parseconfig: use curl_free() to free memory allocated by libcurl
Reported-by: bxac on github Fixes #4730 Closes #4731
This commit is contained in:
parent
f098c9e6f6
commit
23e4d98e7e
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user