diff options
author | Rich Salz <rsalz@openssl.org> | 2015-05-01 14:37:16 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-05-01 14:37:16 -0400 |
commit | 25aaa98aa249d26391c1994d2de449562c8b8b99 (patch) | |
tree | 6f83efd87fa9fd832e8a456e9686143a29f1dab3 /crypto/x509v3/pcy_cache.c | |
parent | 666964780a245c14e8f0eb6e13dd854a37387ea9 (diff) | |
download | openssl-new-25aaa98aa249d26391c1994d2de449562c8b8b99.tar.gz |
free NULL cleanup -- coda
After the finale, the "real" final part. :) Do a recursive grep with
"-B1 -w [a-zA-Z0-9_]*_free" to see if any of the preceeding lines are
an "if NULL" check that can be removed.
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'crypto/x509v3/pcy_cache.c')
-rw-r--r-- | crypto/x509v3/pcy_cache.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/crypto/x509v3/pcy_cache.c b/crypto/x509v3/pcy_cache.c index 1f07fe29ce..1f942604d8 100644 --- a/crypto/x509v3/pcy_cache.c +++ b/crypto/x509v3/pcy_cache.c @@ -110,8 +110,7 @@ static int policy_cache_create(X509 *x, bad_policy: if (ret == -1) x->ex_flags |= EXFLAG_INVALID_POLICY; - if (data) - policy_data_free(data); + policy_data_free(data); sk_POLICYINFO_pop_free(policies, POLICYINFO_free); if (ret <= 0) { sk_X509_POLICY_DATA_pop_free(cache->data, policy_data_free); @@ -206,11 +205,8 @@ static int policy_cache_new(X509 *x) x->ex_flags |= EXFLAG_INVALID_POLICY; just_cleanup: - if (ext_pcons) - POLICY_CONSTRAINTS_free(ext_pcons); - + POLICY_CONSTRAINTS_free(ext_pcons); ASN1_INTEGER_free(ext_any); - return 1; } @@ -219,8 +215,7 @@ void policy_cache_free(X509_POLICY_CACHE *cache) { if (!cache) return; - if (cache->anyPolicy) - policy_data_free(cache->anyPolicy); + policy_data_free(cache->anyPolicy); sk_X509_POLICY_DATA_pop_free(cache->data, policy_data_free); OPENSSL_free(cache); } |