mirror of
https://github.com/moparisthebest/curl
synced 2024-12-24 17:18:48 -05: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
@ -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…
Reference in New Issue
Block a user