mem_calloc -> p_new
[apps/madmutt.git] / smime.c
diff --git a/smime.c b/smime.c
index 95083df..728d111 100644 (file)
--- a/smime.c
+++ b/smime.c
@@ -391,7 +391,7 @@ char *smime_ask_for_key (char *prompt, char *mailbox, short public)
     }
     /* Read Entries */
     cur = 0;
-    Table = mem_calloc (cert_num, sizeof (smime_id));
+    Table = p_new(smime_id, cert_num);
     while (!feof (index)) {
       numFields =
         fscanf (index, MUTT_FORMAT (STRING) " %x.%i " MUTT_FORMAT (STRING),
@@ -856,14 +856,13 @@ static int smime_handle_cert_email (char *certificate, char *mailbox,
 
   if (copy && buffer && num) {
     (*num) = count;
-    *buffer = mem_calloc (sizeof (char *), count);
+    *buffer = p_new(char *, count);
     count = 0;
 
     rewind (fpout);
     while ((fgets (email, sizeof (email), fpout))) {
       *(email + str_len (email) - 1) = '\0';
-      (*buffer)[count] = mem_calloc (1, str_len (email) + 1);
-      strncpy ((*buffer)[count], email, str_len (email));
+      (*buffer)[count] = p_dupstr(email, str_len(email));
       count++;
     }
   }