1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

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
This commit is contained in:
Daniel Stenberg 2020-02-27 14:37:40 +01:00
parent 9d5893105d
commit 81ade13c37
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -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 */