From: Richard Russon Date: Thu, 19 Sep 2019 22:29:12 +0000 (+0100) Subject: fix leak in mutt_attach_mail_sender() X-Git-Tag: 2019-10-25~36^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e4204350d24e7dd53ff241756994639ceefe0dc5;p=neomutt fix leak in mutt_attach_mail_sender() --- diff --git a/recvcmd.c b/recvcmd.c index 37e39a152..8ee1e734e 100644 --- a/recvcmd.c +++ b/recvcmd.c @@ -1073,7 +1073,10 @@ void mutt_attach_mail_sender(FILE *fp, struct Email *e, struct AttachCtx *actx, if (cur) { if (mutt_fetch_recips(e_tmp->env, cur->email->env, SEND_TO_SENDER) == -1) + { + email_free(&e_tmp); return; + } } else { @@ -1082,8 +1085,13 @@ void mutt_attach_mail_sender(FILE *fp, struct Email *e, struct AttachCtx *actx, if (actx->idx[i]->content->tagged && (mutt_fetch_recips(e_tmp->env, actx->idx[i]->content->email->env, SEND_TO_SENDER) == -1)) + { + email_free(&e_tmp); return; + } } } + + // This call will free e_tmp for us ci_send_message(SEND_NO_FLAGS, e_tmp, NULL, NULL, NULL); }