gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnurl] 04/18: curl/parseconfig: fix mem-leak


From: gnunet
Subject: [gnurl] 04/18: curl/parseconfig: fix mem-leak
Date: Fri, 20 Dec 2019 14:49:06 +0100

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository gnurl.

commit f098c9e6f6dab9a2b08e91d2b5180e65166676b6
Author: Daniel Stenberg <address@hidden>
AuthorDate: Wed Dec 18 13:30:39 2019 +0100

    curl/parseconfig: fix mem-leak
    
    When looping, first trying '.curlrc' and then '_curlrc', the function
    would not free the first string.
    
    Closes #4731
---
 src/tool_parsecfg.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/tool_parsecfg.c b/src/tool_parsecfg.c
index 9b32e54a0..208897f48 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 */
+        free(pathalloc);
         /* check for .curlrc then _curlrc in the home dir */
         pathalloc = curl_maprintf("%s%s%ccurlrc", home, DIR_CHAR, prefix);
         if(!pathalloc) {

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]