gnunet-svn
[Top][All Lists]
Advanced

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

[gnurl] 182/282: smtp: overwriting 'from' leaks memory


From: gnunet
Subject: [gnurl] 182/282: smtp: overwriting 'from' leaks memory
Date: Wed, 01 Apr 2020 14:30:47 +0200

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

ng0 pushed a commit to branch master
in repository gnurl.

commit aeb292301acadda60751601c5816d628e6b5e58f
Author: Daniel Stenberg <address@hidden>
AuthorDate: Fri Feb 28 09:49:02 2020 +0100

    smtp: overwriting 'from' leaks memory
    
    Detected by Coverity. CID 1418139.
    
    Also, make sure to return error if the new 'from' allocation fails.
    
    Closes #4997
---
 lib/smtp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/smtp.c b/lib/smtp.c
index 77fcd5afc..e1872871d 100644
--- a/lib/smtp.c
+++ b/lib/smtp.c
@@ -625,6 +625,7 @@ static CURLcode smtp_perform_mail(struct connectdata *conn)
         utf8 = TRUE;
 
       if(host.name) {
+        free(from);
         from = aprintf("<%s@%s>", address, host.name);
 
         Curl_free_idnconverted_hostname(&host);
@@ -635,6 +636,8 @@ static CURLcode smtp_perform_mail(struct connectdata *conn)
         auth = aprintf("<%s>", address);
 
       free(address);
+      if(!from)
+        return CURLE_OUT_OF_MEMORY;
     }
     else
       /* Empty AUTH, RFC-2554, sect. 5 */

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



reply via email to

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