# include "config.h"
#endif
+#include <lib-lib/mem.h>
+
#include "lib/mem.h"
#include "lib/str.h"
bailout:
- mem_free (&p);
+ p_delete(&p);
return NULL;
}
if (!addr)
break;
- chr = mem_malloc (l);
- memcpy (chr, buff + 1, l - 1);
- chr[l - 1] = '\0';
-
+ chr = p_dupstr(buff + 1, l - 1);
*addr = uid = mem_calloc (1, sizeof (pgp_uid_t)); /* XXX */
uid->addr = chr;
size_t error_buf_len;
error_buf_len = sizeof ("fopen: ") - 1 + str_len (ringfile) + 1;
- error_buf = mem_malloc (error_buf_len);
+ error_buf = p_new(char, error_buf_len);
snprintf (error_buf, error_buf_len, "fopen: %s", ringfile);
perror (error_buf);
- mem_free (&error_buf);
+ p_delete(&error_buf);
return;
}
keypos = pos;
}
else if (pt == PT_NAME) {
- char *tmp = mem_malloc (l);
-
- memcpy (tmp, buff + 1, l - 1);
- tmp[l - 1] = '\0';
+ char *tmp = p_dupstr(buff + 1, l - 1);
/* mutt_decode_utf8_string (tmp, chs); */
pgp_free_key (&p);
}
- mem_free (&tmp);
+ p_delete(&tmp);
}
FGETPOS (rfp, pos);