diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2021-12-18 16:15:49 +0100 |
---|---|---|
committer | Dr. David von Oheimb <dev@ddvo.net> | 2021-12-21 12:11:49 +0100 |
commit | 79b2a2f2eedb9d6b24a3f6748332328cf54568fb (patch) | |
tree | 31d61a9636cccc6a378871407b11fc1fc89aa8c6 /demos | |
parent | 0d4c52320d245be80bd69346fdda4b12b4961eae (diff) | |
download | openssl-79b2a2f2eedb9d6b24a3f6748332328cf54568fb.tar.gz |
add OSSL_STACK_OF_X509_free() for commonly used pattern
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17307)
Diffstat (limited to 'demos')
-rw-r--r-- | demos/cms/cms_denc.c | 6 | ||||
-rw-r--r-- | demos/cms/cms_enc.c | 6 | ||||
-rw-r--r-- | demos/pkcs12/pkread.c | 2 | ||||
-rw-r--r-- | demos/smime/smenc.c | 6 |
4 files changed, 10 insertions, 10 deletions
diff --git a/demos/cms/cms_denc.c b/demos/cms/cms_denc.c index 60b0aa192b..4a2219dee3 100644 --- a/demos/cms/cms_denc.c +++ b/demos/cms/cms_denc.c @@ -46,8 +46,8 @@ int main(int argc, char **argv) goto err; /* - * sk_X509_pop_free will free up recipient STACK and its contents so set - * rcert to NULL so it isn't freed up twice. + * OSSL_STACK_OF_X509_free() free up recipient STACK and its contents + * so set rcert to NULL so it isn't freed up twice. */ rcert = NULL; @@ -88,7 +88,7 @@ int main(int argc, char **argv) CMS_ContentInfo_free(cms); X509_free(rcert); - sk_X509_pop_free(recips, X509_free); + OSSL_STACK_OF_X509_free(recips); BIO_free(in); BIO_free(out); BIO_free(dout); diff --git a/demos/cms/cms_enc.c b/demos/cms/cms_enc.c index 9ef7a39558..ff5632a714 100644 --- a/demos/cms/cms_enc.c +++ b/demos/cms/cms_enc.c @@ -47,8 +47,8 @@ int main(int argc, char **argv) goto err; /* - * sk_X509_pop_free will free up recipient STACK and its contents so set - * rcert to NULL so it isn't freed up twice. + * OSSL_STACK_OF_X509_free() will free up recipient STACK and its contents + * so set rcert to NULL so it isn't freed up twice. */ rcert = NULL; @@ -84,7 +84,7 @@ int main(int argc, char **argv) CMS_ContentInfo_free(cms); X509_free(rcert); - sk_X509_pop_free(recips, X509_free); + OSSL_STACK_OF_X509_free(recips); BIO_free(in); BIO_free(out); BIO_free(tbio); diff --git a/demos/pkcs12/pkread.c b/demos/pkcs12/pkread.c index 3b153f8edf..7deeef9ef0 100644 --- a/demos/pkcs12/pkread.c +++ b/demos/pkcs12/pkread.c @@ -105,7 +105,7 @@ int main(int argc, char **argv) OPENSSL_free(name); X509_free(cert); EVP_PKEY_free(pkey); - sk_X509_pop_free(ca, X509_free); + OSSL_STACK_OF_X509_free(ca); return ret; } diff --git a/demos/smime/smenc.c b/demos/smime/smenc.c index 0714dddfd2..ab44a22bb3 100644 --- a/demos/smime/smenc.c +++ b/demos/smime/smenc.c @@ -47,8 +47,8 @@ int main(int argc, char **argv) goto err; /* - * sk_X509_pop_free will free up recipient STACK and its contents so set - * rcert to NULL so it isn't freed up twice. + * OSSL_STACK_OF_X509_free() will free up recipient STACK and its contents + * so set rcert to NULL so it isn't freed up twice. */ rcert = NULL; @@ -82,7 +82,7 @@ int main(int argc, char **argv) } PKCS7_free(p7); X509_free(rcert); - sk_X509_pop_free(recips, X509_free); + OSSL_STACK_OF_X509_free(recips); BIO_free(in); BIO_free(out); BIO_free(tbio); |