summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosef Larsson <josla972@student.liu.se>2014-10-08 18:44:07 (GMT)
committerJosef Larsson <josla972@student.liu.se>2014-10-08 18:44:07 (GMT)
commit5cac430d8f9e9a5e6bc39577060e1bb41c2495b5 (patch)
treefbadd11f047efd5a4370811192797f415d0619d1
parent25a38131993ae715fe584d7b612e67b75fa3ef9c (diff)
downloadfribid-5cac430d8f9e9a5e6bc39577060e1bb41c2495b5.zip
fribid-5cac430d8f9e9a5e6bc39577060e1bb41c2495b5.tar.gz
fribid-5cac430d8f9e9a5e6bc39577060e1bb41c2495b5.tar.bz2
Only free(origin) when we are done using it.
-rw-r--r--client/pkcs12.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/client/pkcs12.c b/client/pkcs12.c
index a88258b..af4d4d1 100644
--- a/client/pkcs12.c
+++ b/client/pkcs12.c
@@ -694,7 +694,6 @@ static TokenError storeCertificates(STACK_OF(X509) *certs,
char *origin = certutil_getBagAttr(bag, objOwningHost);
bool equal = (origin && strcmp(origin, hostname) == 0);
- free(origin);
ASN1_OBJECT_free(objOwningHost);
if (!equal) {
char *str = rasprintf("file=%s, request=%s", origin, hostname);
@@ -702,7 +701,8 @@ static TokenError storeCertificates(STACK_OF(X509) *certs,
hostname_mismatch = true;
continue;
}
-
+ free(origin);
+
// Extract cert from bag
X509 *cert = PKCS12_certbag2x509(bag);
if (!cert) {