diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-02-27 14:37:40 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-02-27 14:37:40 +0100 |
commit | 5c072c0bd2a7d87215fc47096f8c33e99330f2e7 (patch) | |
tree | 3f0c9e64b893819bb97fb80a64e1b86b5d1f1b95 | |
parent | 1d1e9e8ad7a5f35818dc7072e6fbe8a76a93e018 (diff) | |
download | curl-bagder/smtp-memleak.tar.gz |
smtp: fix memory leak on exit pathbagder/smtp-memleak
Detected by Coverity. CID 1418139. "leaked_storage: Variable 'from'
going out of scope leaks the storage it points to"
-rw-r--r-- | lib/smtp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/smtp.c b/lib/smtp.c index 79499e6d4..77fcd5afc 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 */ |