diff options
author | Rich Salz <rsalz@openssl.org> | 2015-03-24 07:52:24 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-03-24 07:52:24 -0400 |
commit | 0dfb9398bb6493d5a56216e0c7039cb3f9fc88c6 (patch) | |
tree | 9ffaa0bec3d0f14092948174eeea90dc8e2ee7c4 /crypto/dh/dh_ameth.c | |
parent | 7c82e339a677f8546e1456c7a8f6788598a9de43 (diff) |
free NULL cleanup
Start ensuring all OpenSSL "free" routines allow NULL, and remove
any if check before calling them.
This gets ASN1_OBJECT_free and ASN1_STRING_free.
Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'crypto/dh/dh_ameth.c')
-rw-r--r-- | crypto/dh/dh_ameth.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/crypto/dh/dh_ameth.c b/crypto/dh/dh_ameth.c index 2c77381a48..e7d56f1a89 100644 --- a/crypto/dh/dh_ameth.c +++ b/crypto/dh/dh_ameth.c @@ -191,8 +191,7 @@ static int dh_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey) err: if (penc) OPENSSL_free(penc); - if (str) - ASN1_STRING_free(str); + ASN1_STRING_free(str); return 0; } @@ -297,8 +296,7 @@ static int dh_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey) err: if (dp != NULL) OPENSSL_free(dp); - if (params != NULL) - ASN1_STRING_free(params); + ASN1_STRING_free(params); if (prkey != NULL) ASN1_STRING_clear_free(prkey); return 0; |