diff options
author | Rich Salz <rsalz@openssl.org> | 2015-04-30 17:33:59 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-04-30 17:33:59 -0400 |
commit | 222561fe8ef510f336417a666f69f81ddc9b8fe4 (patch) | |
tree | 70bc6af70550022bc7b7af45bd3c6d64d7fc2680 /demos/cms | |
parent | 2ace745022f5af0709297e96eb0b0829c87c4291 (diff) |
free NULL cleanup 5a
Don't check for NULL before calling a free routine. This gets X509_.*free:
x509_name_ex_free X509_policy_tree_free X509_VERIFY_PARAM_free
X509_STORE_free X509_STORE_CTX_free X509_PKEY_free
X509_OBJECT_free_contents X509_LOOKUP_free X509_INFO_free
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'demos/cms')
-rw-r--r-- | demos/cms/cms_ddec.c | 3 | ||||
-rw-r--r-- | demos/cms/cms_dec.c | 3 | ||||
-rw-r--r-- | demos/cms/cms_denc.c | 6 | ||||
-rw-r--r-- | demos/cms/cms_enc.c | 6 | ||||
-rw-r--r-- | demos/cms/cms_sign.c | 3 | ||||
-rw-r--r-- | demos/cms/cms_sign2.c | 8 | ||||
-rw-r--r-- | demos/cms/cms_ver.c | 3 |
7 files changed, 10 insertions, 22 deletions
diff --git a/demos/cms/cms_ddec.c b/demos/cms/cms_ddec.c index 1e06cea5c7..36bb4ee081 100644 --- a/demos/cms/cms_ddec.c +++ b/demos/cms/cms_ddec.c @@ -70,8 +70,7 @@ int main(int argc, char **argv) if (cms) CMS_ContentInfo_free(cms); - if (rcert) - X509_free(rcert); + X509_free(rcert); EVP_PKEY_free(rkey); BIO_free(in); diff --git a/demos/cms/cms_dec.c b/demos/cms/cms_dec.c index 71a0e4ffdd..832b54d43c 100644 --- a/demos/cms/cms_dec.c +++ b/demos/cms/cms_dec.c @@ -61,8 +61,7 @@ int main(int argc, char **argv) if (cms) CMS_ContentInfo_free(cms); - if (rcert) - X509_free(rcert); + X509_free(rcert); EVP_PKEY_free(rkey); BIO_free(in); diff --git a/demos/cms/cms_denc.c b/demos/cms/cms_denc.c index 852671771c..f91fec1df3 100644 --- a/demos/cms/cms_denc.c +++ b/demos/cms/cms_denc.c @@ -79,10 +79,8 @@ int main(int argc, char **argv) if (cms) CMS_ContentInfo_free(cms); - if (rcert) - X509_free(rcert); - if (recips) - sk_X509_pop_free(recips, X509_free); + X509_free(rcert); + sk_X509_pop_free(recips, X509_free); BIO_free(in); BIO_free(out); diff --git a/demos/cms/cms_enc.c b/demos/cms/cms_enc.c index 4395e6b04f..ba62f7920e 100644 --- a/demos/cms/cms_enc.c +++ b/demos/cms/cms_enc.c @@ -75,10 +75,8 @@ int main(int argc, char **argv) if (cms) CMS_ContentInfo_free(cms); - if (rcert) - X509_free(rcert); - if (recips) - sk_X509_pop_free(recips, X509_free); + X509_free(rcert); + sk_X509_pop_free(recips, X509_free); BIO_free(in); BIO_free(out); diff --git a/demos/cms/cms_sign.c b/demos/cms/cms_sign.c index 3ad5ce8c18..e9871dfd36 100644 --- a/demos/cms/cms_sign.c +++ b/demos/cms/cms_sign.c @@ -71,8 +71,7 @@ int main(int argc, char **argv) if (cms) CMS_ContentInfo_free(cms); - if (scert) - X509_free(scert); + X509_free(scert); EVP_PKEY_free(skey); BIO_free(in); diff --git a/demos/cms/cms_sign2.c b/demos/cms/cms_sign2.c index 3276de1b2a..127f5860ee 100644 --- a/demos/cms/cms_sign2.c +++ b/demos/cms/cms_sign2.c @@ -80,14 +80,10 @@ int main(int argc, char **argv) if (cms) CMS_ContentInfo_free(cms); - if (scert) - X509_free(scert); + X509_free(scert); EVP_PKEY_free(skey); - - if (scert2) - X509_free(scert2); + X509_free(scert2); EVP_PKEY_free(skey2); - BIO_free(in); BIO_free(out); BIO_free(tbio); diff --git a/demos/cms/cms_ver.c b/demos/cms/cms_ver.c index 422753163e..0f34bbf335 100644 --- a/demos/cms/cms_ver.c +++ b/demos/cms/cms_ver.c @@ -70,8 +70,7 @@ int main(int argc, char **argv) if (cms) CMS_ContentInfo_free(cms); - if (cacert) - X509_free(cacert); + X509_free(cacert); BIO_free(in); BIO_free(out); |