summaryrefslogtreecommitdiff
path: root/pith/smkeys.c
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2016-02-28 23:53:52 -0700
committerEduardo Chappa <chappa@washington.edu>2016-02-28 23:53:52 -0700
commit0bb3a0be1d23f86b4741102d3ea2c9fc4ef4b5af (patch)
tree51a2d8d59de4e0fb1a4abc3dcdca6c2db6f8e492 /pith/smkeys.c
parentf79d3985bcf67ed2c0893c4a41fa8b7b1736a02a (diff)
downloadalpine-0bb3a0be1d23f86b4741102d3ea2c9fc4ef4b5af.tar.xz
* Changes to make Alpine build when PASSFILE is not specified and
adding memory freeing calls when necessary.
Diffstat (limited to 'pith/smkeys.c')
-rw-r--r--pith/smkeys.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/pith/smkeys.c b/pith/smkeys.c
index 415bc190..ce58ed41 100644
--- a/pith/smkeys.c
+++ b/pith/smkeys.c
@@ -1106,6 +1106,7 @@ mem_to_personal_certs(char *contents)
pc = (PERSONAL_CERT *) fs_get(sizeof(*pc));
pc->cert = cert;
pc->name = cpystr(name);
+ pc->cname = NULL;
pc->keytext = keytext; /* a pointer into contents */
pc->key = load_key(pc, "", SM_NORMALCERT);
@@ -1347,12 +1348,11 @@ void
free_personal_certs(PERSONAL_CERT **pc)
{
if(pc && *pc){
- free_personal_certs(&(*pc)->next);
if((*pc)->name)
fs_give((void **) &(*pc)->name);
- if((*pc)->name)
- fs_give((void **) &(*pc)->name);
+ if((*pc)->cname)
+ fs_give((void **) &(*pc)->cname);
if((*pc)->cert)
X509_free((*pc)->cert);
@@ -1360,6 +1360,8 @@ free_personal_certs(PERSONAL_CERT **pc)
if((*pc)->key)
EVP_PKEY_free((*pc)->key);
+ free_personal_certs(&(*pc)->next);
+
fs_give((void **) pc);
}
}