Use good m_ functions, because it smell like a flower, version 2.
[apps/madmutt.git] / lib-mx / mx.c
index 3d10313..1caefe5 100644 (file)
@@ -17,6 +17,7 @@
 #include <lib-ui/sidebar.h>
 
 #include "mutt.h"
+#include "pattern.h"
 #include "buffy.h"
 #include "mx.h"
 #include "mbox.h"
@@ -430,7 +431,7 @@ static int mx_open_mailbox_append (CONTEXT * ctx, int flags)
         mutt_perror (ctx->path);
       else {
         mutt_error (_("Couldn't lock %s\n"), ctx->path);
-        safe_fclose (&ctx->fp);
+        m_fclose(&ctx->fp);
       }
       return (-1);
     }
@@ -566,9 +567,8 @@ void mx_fastclose_mailbox (CONTEXT * ctx)
 
   p_delete(&ctx->path);
   p_delete(&ctx->pattern);
-  if (ctx->limit_pattern)
-    mutt_pattern_free (&ctx->limit_pattern);
-  safe_fclose (&ctx->fp);
+  pattern_list_wipe(&ctx->limit_pattern);
+  m_fclose(&ctx->fp);
   p_clear(ctx, 1);
 }
 
@@ -1190,7 +1190,7 @@ int mx_close_message (MESSAGE ** msg)
       || (*msg)->magic == M_NNTP
 #endif
     ) {
-    r = safe_fclose (&(*msg)->fp);
+    r = m_fclose(&(*msg)->fp);
   }
   else
     (*msg)->fp = NULL;