don't deref ops, they might be null.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24692 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2009-02-14 04:17:47 +00:00
parent 51fc4ba5a1
commit aad4e9c130

View File

@@ -2019,10 +2019,10 @@ _hx509_private_key_free(hx509_private_key *key)
if (--(*key)->ref > 0) if (--(*key)->ref > 0)
return 0; return 0;
if (der_heim_oid_cmp((*key)->ops->key_oid, &asn1_oid_id_pkcs1_rsaEncryption) == 0) { if ((*key)->ops && der_heim_oid_cmp((*key)->ops->key_oid, &asn1_oid_id_pkcs1_rsaEncryption) == 0) {
if ((*key)->private_key.rsa) if ((*key)->private_key.rsa)
RSA_free((*key)->private_key.rsa); RSA_free((*key)->private_key.rsa);
} else if (der_heim_oid_cmp((*key)->ops->key_oid, &asn1_oid_id_ecPublicKey) == 0) { } else if ((*key)->ops && der_heim_oid_cmp((*key)->ops->key_oid, &asn1_oid_id_ecPublicKey) == 0) {
if ((*key)->private_key.ecdsa) if ((*key)->private_key.ecdsa)
EC_KEY_free((*key)->private_key.ecdsa); EC_KEY_free((*key)->private_key.ecdsa);
} }