mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-02-04 21:39:49 +00:00
apps/smtp: Fix memory leak in smtp_send_mail_alloced error paths
Call smtp_free_struct(s) in all smtp_send_mail_alloced error paths to ensure no memory leak. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net>
This commit is contained in:
parent
ec9096be40
commit
9dee346000
@ -483,20 +483,24 @@ smtp_send_mail_alloced(struct smtp_session *s)
|
||||
* - only 7-bit ASCII is allowed
|
||||
*/
|
||||
if (smtp_verify(s->to, s->to_len, 0) != ERR_OK) {
|
||||
return ERR_ARG;
|
||||
err = ERR_ARG;
|
||||
goto leave;
|
||||
}
|
||||
if (smtp_verify(s->from, s->from_len, 0) != ERR_OK) {
|
||||
return ERR_ARG;
|
||||
err = ERR_ARG;
|
||||
goto leave;
|
||||
}
|
||||
if (smtp_verify(s->subject, s->subject_len, 0) != ERR_OK) {
|
||||
return ERR_ARG;
|
||||
err = ERR_ARG;
|
||||
goto leave;
|
||||
}
|
||||
#if SMTP_BODYDH
|
||||
if (s->bodydh == NULL)
|
||||
#endif /* SMTP_BODYDH */
|
||||
{
|
||||
if (smtp_verify(s->body, s->body_len, 0) != ERR_OK) {
|
||||
return ERR_ARG;
|
||||
err = ERR_ARG;
|
||||
goto leave;
|
||||
}
|
||||
}
|
||||
#endif /* SMTP_CHECK_DATA */
|
||||
|
Loading…
x
Reference in New Issue
Block a user