add OSSL_STACK_OF_X509_free() for commonly used pattern
[openssl.git] / demos / cms / cms_enc.c
index 9ef7a395583dc8191e1d1cee093631a7f3ea9e18..ff5632a714fdce7ef5f2e166e0f3f6a40e3af8ee 100644 (file)
@@ -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);