}
/* Return a copy of KEY. */
-static crypt_key_t *crypt_copy_key (crypt_key_t * key)
+static crypt_key_t *crypt_copy_key (crypt_key_t *key)
{
crypt_key_t *k;
- k = mem_calloc (1, sizeof *k);
+ k = p_new(crypt_key_t, 1);
k->kobj = key->kobj;
gpgme_key_ref (key->kobj);
k->idx = key->idx;
n++; /* delimiter or end of string */
}
n++; /* make sure to allocate at least one byte */
- pattern = p = mem_calloc (1, n);
+ pattern = p = p_new(char, n);
for (l = list; l; l = l->next) {
s = l->data;
if (*s) {
if (!n)
goto no_pgphints;
- patarr = mem_calloc (n + 1, sizeof *patarr);
+ patarr = p_new(char *, n + 1);
for (l = hints, n = 0; l; l = l->next) {
if (l->data && *l->data)
patarr[n++] = str_dup (l->data);
#endif /* DISABLED code */
for (idx = 0, uid = key->uids; uid; idx++, uid = uid->next) {
- k = mem_calloc (1, sizeof *k);
+ k = p_new(crypt_key_t, 1);
k->kobj = key;
k->idx = idx;
k->uid = uid->uid;
flags |= KEYFLAG_CANSIGN;
for (idx = 0, uid = key->uids; uid; idx++, uid = uid->next) {
- k = mem_calloc (1, sizeof *k);
+ k = p_new(crypt_key_t, 1);
k->kobj = key;
k->idx = idx;
k->uid = uid->uid;