]> granicus.if.org Git - mutt/commitdiff
Fix memory leak in compose write-fcc function.
authorKevin McCarthy <kevin@8t8.us>
Sun, 22 Sep 2019 22:59:27 +0000 (15:59 -0700)
committerKevin McCarthy <kevin@8t8.us>
Sun, 22 Sep 2019 22:59:27 +0000 (15:59 -0700)
The outer multipart was not being freed after writing.

compose.c

index cbcd0d01f12c85a1eb86f2e43a0f2063813f0bac..484435f4dacb5635356671c59f32f3606fc52f66 100644 (file)
--- 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;