From: Daniel Stenberg Date: Thu, 27 Feb 2020 13:37:40 +0000 (+0100) Subject: smtp: fix memory leak on exit path X-Git-Tag: curl-7_69_0~58 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=81ade13c373c9569074e6f881fe9348123a7ed7c;p=thirdparty%2Fcurl.git smtp: fix memory leak on exit path Detected by Coverity. CID 1418139. "leaked_storage: Variable 'from' going out of scope leaks the storage it points to" Closes #4990 --- diff --git a/lib/smtp.c b/lib/smtp.c index 79499e6d40..77fcd5afc8 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -612,8 +612,10 @@ static CURLcode smtp_perform_mail(struct connectdata *conn) converting the host name to an IDN A-label if necessary */ result = smtp_parse_address(conn, data->set.str[STRING_MAIL_AUTH], &address, &host); - if(result) + if(result) { + free(from); return result; + } /* Establish whether we should report SMTPUTF8 to the server for this mailbox as per RFC-6531 sect. 3.1 point 4 and sect. 3.4 */