diff options
author | Rich Salz <rsalz@openssl.org> | 2015-03-28 10:54:15 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-03-28 10:54:15 -0400 |
commit | c5ba2d990420e1778ca4a90bf882e0f806404af0 (patch) | |
tree | 61641d19bea624b7fa523162f0ebb0d5e2fccf55 /crypto/pem/pem_pkey.c | |
parent | 33b188a8e82df57208ec8263c263f8b6f47e8255 (diff) |
free NULL cleanup
EVP_.*free; this gets:
EVP_CIPHER_CTX_free EVP_PKEY_CTX_free EVP_PKEY_asn1_free
EVP_PKEY_asn1_set_free EVP_PKEY_free EVP_PKEY_free_it
EVP_PKEY_meth_free; and also EVP_CIPHER_CTX_cleanup
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Diffstat (limited to 'crypto/pem/pem_pkey.c')
-rw-r--r-- | crypto/pem/pem_pkey.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/crypto/pem/pem_pkey.c b/crypto/pem/pem_pkey.c index fd7e8b0376..80c316ed38 100644 --- a/crypto/pem/pem_pkey.c +++ b/crypto/pem/pem_pkey.c @@ -96,8 +96,7 @@ EVP_PKEY *PEM_read_bio_PrivateKey(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, goto p8err; ret = EVP_PKCS82PKEY(p8inf); if (x) { - if (*x) - EVP_PKEY_free((EVP_PKEY *)*x); + EVP_PKEY_free((EVP_PKEY *)*x); *x = ret; } PKCS8_PRIV_KEY_INFO_free(p8inf); @@ -124,8 +123,7 @@ EVP_PKEY *PEM_read_bio_PrivateKey(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, goto p8err; ret = EVP_PKCS82PKEY(p8inf); if (x) { - if (*x) - EVP_PKEY_free((EVP_PKEY *)*x); + EVP_PKEY_free((EVP_PKEY *)*x); *x = ret; } PKCS8_PRIV_KEY_INFO_free(p8inf); @@ -186,8 +184,7 @@ EVP_PKEY *PEM_read_bio_Parameters(BIO *bp, EVP_PKEY **x) goto err; } if (x) { - if (*x) - EVP_PKEY_free((EVP_PKEY *)*x); + EVP_PKEY_free((EVP_PKEY *)*x); *x = ret; } } |