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/dsa | |
parent | 7c82e339a677f8546e1456c7a8f6788598a9de43 (diff) | |
download | openssl-0dfb9398bb6493d5a56216e0c7039cb3f9fc88c6.tar.gz |
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/dsa')
-rw-r--r-- | crypto/dsa/dsa_ameth.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/crypto/dsa/dsa_ameth.c b/crypto/dsa/dsa_ameth.c index d63c417d9f..425144ac1c 100644 --- a/crypto/dsa/dsa_ameth.c +++ b/crypto/dsa/dsa_ameth.c @@ -166,8 +166,7 @@ static int dsa_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; } @@ -328,8 +327,7 @@ static int dsa_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; |