free memory on failure, don't operate on NULL.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21146 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2007-06-18 21:37:25 +00:00
parent af2893a890
commit 552ac7f547

View File

@@ -90,7 +90,7 @@ keyBag_parser(hx509_context context,
&ki.privateKeyAlgorithm, &ki.privateKeyAlgorithm,
NULL, NULL,
&ki.privateKey, &ki.privateKey,
&attr->attrValues); os);
free_PKCS8PrivateKeyInfo(&ki); free_PKCS8PrivateKeyInfo(&ki);
return 0; return 0;
} }
@@ -431,7 +431,9 @@ p12_init(hx509_context context,
out: out:
_hx509_collector_free(c); _hx509_collector_free(c);
if (ret) { if (ret && p12) {
if (p12->fn)
free(p12->fn);
if (p12->certs) if (p12->certs)
hx509_certs_free(&p12->certs); hx509_certs_free(&p12->certs);
free(p12); free(p12);