[openssl] OpenSSL_1_1_1-stable update

Dr. Paul Dale pauli at openssl.org
Tue Oct 6 22:58:39 UTC 2020


The branch OpenSSL_1_1_1-stable has been updated
       via  7455f247e6f9d621fa79ae3af1588df23078fb11 (commit)
      from  ae9bcce2ab57d19119a85788eb48f8e8ba8ed3ee (commit)


- Log -----------------------------------------------------------------
commit 7455f247e6f9d621fa79ae3af1588df23078fb11
Author: Benny Baumann <BenBE at geshi.org>
Date:   Fri Oct 2 01:06:12 2020 +0200

    Avoid memory leak of parent on allocation failure for child structure
    
    Reviewed-by: Ben Kaduk <kaduk at mit.edu>
    Reviewed-by: Dmitry Belyavskiy <beldmit at gmail.com>
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    Reviewed-by: Paul Dale <paul.dale at oracle.com>
    (Merged from https://github.com/openssl/openssl/pull/13055)
    
    (cherry picked from commit a21db568bf3d0ab4194fd3e0917ee982f1fc8bfd)

-----------------------------------------------------------------------

Summary of changes:
 apps/cms.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/apps/cms.c b/apps/cms.c
index 15edd67dbe..60691f1468 100644
--- a/apps/cms.c
+++ b/apps/cms.c
@@ -545,9 +545,11 @@ int cms_main(int argc, char **argv)
             if (key_param == NULL || key_param->idx != keyidx) {
                 cms_key_param *nparam;
                 nparam = app_malloc(sizeof(*nparam), "key param buffer");
-                nparam->idx = keyidx;
-                if ((nparam->param = sk_OPENSSL_STRING_new_null()) == NULL)
+                if ((nparam->param = sk_OPENSSL_STRING_new_null()) == NULL) {
+                    OPENSSL_free(nparam);
                     goto end;
+                }
+                nparam->idx = keyidx;
                 nparam->next = NULL;
                 if (key_first == NULL)
                     key_first = nparam;


More information about the openssl-commits mailing list