From: Richard Russon Date: Thu, 15 Mar 2018 16:02:21 +0000 (+0000) Subject: fix crash with incomplete template X-Git-Tag: neomutt-20180323~13^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=refs%2Fpull%2F1059%2Fhead;p=neomutt fix crash with incomplete template --- diff --git a/main.c b/main.c index e17d9eb3f..9702b01f0 100644 --- a/main.c +++ b/main.c @@ -792,7 +792,13 @@ int main(int argc, char **argv, char **env) } context_hdr->content->length = st.st_size; - mutt_prepare_template(fin, NULL, msg, context_hdr, 0); + if (mutt_prepare_template(fin, NULL, msg, context_hdr, 0) < 0) + { + mutt_error(_("Cannot parse message template: %s"), draft_file); + mutt_env_free(&opts_env); + mutt_free_header(&context_hdr); + goto main_curses; + } /* Scan for neomutt header to set ResumeDraftFiles */ struct ListNode *np, *tmp;