mirror of
https://github.com/curl/curl.git
synced 2026-07-24 16:47:16 +03:00
curl/parseconfig: fix mem-leak
When looping, first trying '.curlrc' and then '_curlrc', the function would not free the first string. Closes #4731
This commit is contained in:
parent
14f8b6e69e
commit
f098c9e6f6
1 changed files with 2 additions and 0 deletions
|
|
@ -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 */
|
||||
free(pathalloc);
|
||||
/* check for .curlrc then _curlrc in the home dir */
|
||||
pathalloc = curl_maprintf("%s%s%ccurlrc", home, DIR_CHAR, prefix);
|
||||
if(!pathalloc) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue