fix regressions
[apps/madmutt.git] / enter.c
diff --git a/enter.c b/enter.c
index b979a2e..1b97bd4 100644 (file)
--- a/enter.c
+++ b/enter.c
@@ -12,6 +12,8 @@
 # include "config.h"
 #endif
 
+#include <lib-lib/mem.h>
+
 #include "mutt.h"
 #include "enter.h"
 #include "mutt_menu.h"
@@ -149,7 +151,7 @@ static void replace_part (ENTER_STATE *state, size_t from, const char *buf)
 {
   /* Save the suffix */
   size_t savelen = state->lastchar - state->curpos;
-  wchar_t *savebuf = mem_calloc (savelen, sizeof (wchar_t));
+  wchar_t *savebuf = p_new(wchar_t, savelen);
 
   memcpy (savebuf, state->wbuf + state->curpos, savelen * sizeof (wchar_t));
 
@@ -166,7 +168,7 @@ static void replace_part (ENTER_STATE *state, size_t from, const char *buf)
   memcpy (state->wbuf + state->curpos, savebuf, savelen * sizeof (wchar_t));
   state->lastchar = state->curpos + savelen;
 
-  mem_free (&savebuf);
+  p_delete(&savebuf);
 }
 
 /*
@@ -636,7 +638,7 @@ int _mutt_enter_string (char *buf, size_t buflen, int y, int x,
           char **tfiles;
 
           *numfiles = 1;
-          tfiles = mem_calloc (*numfiles, sizeof (char *));
+          tfiles = p_new(char *, *numfiles);
           mutt_expand_path (buf, buflen);
           tfiles[0] = str_dup (buf);
           *files = tfiles;
@@ -663,7 +665,7 @@ int _mutt_enter_string (char *buf, size_t buflen, int y, int x,
 
 bye:
 
-  mem_free (&tempbuf);
+  p_delete(&tempbuf);
   return rv;
 }
 
@@ -672,8 +674,8 @@ void mutt_free_enter_state (ENTER_STATE ** esp)
   if (!esp)
     return;
 
-  mem_free (&(*esp)->wbuf);
-  mem_free (esp);
+  p_delete(&(*esp)->wbuf);
+  p_delete(esp);
 }
 
 /*