summaryrefslogtreecommitdiffstats
path: root/crypto/rsa/rsa_ameth.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2015-03-24 07:52:24 -0400
committerRich Salz <rsalz@openssl.org>2015-03-24 07:52:24 -0400
commit0dfb9398bb6493d5a56216e0c7039cb3f9fc88c6 (patch)
tree9ffaa0bec3d0f14092948174eeea90dc8e2ee7c4 /crypto/rsa/rsa_ameth.c
parent7c82e339a677f8546e1456c7a8f6788598a9de43 (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/rsa/rsa_ameth.c')
-rw-r--r--crypto/rsa/rsa_ameth.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/crypto/rsa/rsa_ameth.c b/crypto/rsa/rsa_ameth.c
index 6f4c104858..071dbb8d68 100644
--- a/crypto/rsa/rsa_ameth.c
+++ b/crypto/rsa/rsa_ameth.c
@@ -484,8 +484,7 @@ static int rsa_md_to_mgf1(X509_ALGOR **palg, const EVP_MD *mgf1md)
X509_ALGOR_set0(*palg, OBJ_nid2obj(NID_mgf1), V_ASN1_SEQUENCE, stmp);
stmp = NULL;
err:
- if (stmp)
- ASN1_STRING_free(stmp);
+ ASN1_STRING_free(stmp);
if (algtmp)
X509_ALGOR_free(algtmp);
if (*palg)
@@ -576,8 +575,7 @@ static ASN1_STRING *rsa_ctx_to_pss(EVP_PKEY_CTX *pkctx)
RSA_PSS_PARAMS_free(pss);
if (rv)
return os;
- if (os)
- ASN1_STRING_free(os);
+ ASN1_STRING_free(os);
return NULL;
}
@@ -921,8 +919,7 @@ static int rsa_cms_encrypt(CMS_RecipientInfo *ri)
err:
if (oaep)
RSA_OAEP_PARAMS_free(oaep);
- if (os)
- ASN1_STRING_free(os);
+ ASN1_STRING_free(os);
return rv;
}