aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-02-27 14:37:40 +0100
committerDaniel Stenberg <daniel@haxx.se>2020-02-27 17:08:30 +0100
commit81ade13c373c9569074e6f881fe9348123a7ed7c (patch)
tree238b726e5779238f12019b1a42bbb4ffb0519ab9 /lib
parent9d5893105d554d1792a7cec42038529778ab5e35 (diff)
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
Diffstat (limited to 'lib')
-rw-r--r--lib/smtp.c4
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 */