From: Kevin McCarthy Date: Sun, 22 Sep 2019 22:59:27 +0000 (-0700) Subject: Fix memory leak in compose write-fcc function. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4d2f645ab8c1508356227e2e8507b63be9c06c16;p=mutt Fix memory leak in compose write-fcc function. The outer multipart was not being freed after writing. --- diff --git a/compose.c b/compose.c index cbcd0d01..484435f4 100644 --- a/compose.c +++ b/compose.c @@ -1610,10 +1610,10 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */ if (msg->content->next) msg->content = mutt_make_multipart (msg->content); - if (mutt_write_fcc (mutt_b2s (fname), msg, NULL, 0, NULL) < 0) - msg->content = mutt_remove_multipart (msg->content); - else + if (mutt_write_fcc (mutt_b2s (fname), msg, NULL, 0, NULL) == 0) mutt_message _("Message written."); + + msg->content = mutt_remove_multipart (msg->content); } break;