]> granicus.if.org Git - mutt/commitdiff
Fix memleak in the new trash folder code.
authorKevin McCarthy <kevin@8t8.us>
Thu, 21 Jul 2016 21:00:24 +0000 (14:00 -0700)
committerKevin McCarthy <kevin@8t8.us>
Thu, 21 Jul 2016 21:00:24 +0000 (14:00 -0700)
Free the context in opened in trash_append()

mx.c

diff --git a/mx.c b/mx.c
index 70f31f7412c6f0bda4f7a9d8f0a058efc6d9b1d7..86d02ced625ae050f717830e2682cfc06ef36343 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -849,11 +849,13 @@ static int trash_append (CONTEXT *ctx)
         if (mutt_append_message (ctx_trash, ctx, ctx->hdrs[i], 0, 0) == -1)
         {
           mx_close_mailbox (ctx_trash, NULL);
+          FREE (&ctx_trash);
           return -1;
         }
       }
 
     mx_close_mailbox (ctx_trash, NULL);
+    FREE (&ctx_trash);
   }
   else
   {