[openssl-commits] [openssl] OpenSSL_1_1_0-stable update

Matt Caswell matt at openssl.org
Mon Sep 26 16:31:47 UTC 2016


The branch OpenSSL_1_1_0-stable has been updated
       via  7cac0558008a1f46218191e6f26fa7f08256f582 (commit)
      from  a12778be1782bb63055e7641c814d4fce1775e57 (commit)


- Log -----------------------------------------------------------------
commit 7cac0558008a1f46218191e6f26fa7f08256f582
Author: Matt Caswell <matt at openssl.org>
Date:   Mon Sep 26 12:04:23 2016 +0100

    Fix some mem leaks in sslapitest
    
    A mem leak could occur on an error path. Also the mempacket BIO_METHOD
    needs to be cleaned up, because of the newly added DTLS test.
    
    Also fixed a double semi-colon in ssltestlib.c
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (cherry picked from commit fa454945cf2855fed452ff9bdb1876096bc07beb)

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

Summary of changes:
 test/sslapitest.c | 10 ++++++++--
 test/ssltestlib.c |  2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/test/sslapitest.c b/test/sslapitest.c
index acb2087..b08eb8c 100644
--- a/test/sslapitest.c
+++ b/test/sslapitest.c
@@ -46,14 +46,18 @@ static int execute_test_large_message(const SSL_METHOD *smeth,
         goto end;
     }
     chaincert = PEM_read_bio_X509(certbio, NULL, NULL, NULL);
+    BIO_free(certbio);
+    certbio = NULL;
+    if (chaincert == NULL) {
+        printf("Unable to load certificate for chain\n");
+        goto end;
+    }
 
     if (!create_ssl_ctx_pair(smeth, cmeth, &sctx,
                              &cctx, cert, privkey)) {
         printf("Unable to create SSL_CTX pair\n");
         goto end;
     }
-    BIO_free(certbio);
-    certbio = NULL;
 
     /*
      * We assume the supplied certificate is big enough so that if we add
@@ -870,6 +874,8 @@ int main(int argc, char *argv[])
 
     testresult = run_tests(argv[0]);
 
+    bio_s_mempacket_test_free();
+
 #ifndef OPENSSL_NO_CRYPTO_MDEBUG
     if (CRYPTO_mem_leaks(err) <= 0)
         testresult = 1;
diff --git a/test/ssltestlib.c b/test/ssltestlib.c
index 9fcd98d..655fc05 100644
--- a/test/ssltestlib.c
+++ b/test/ssltestlib.c
@@ -587,7 +587,7 @@ int create_ssl_objects(SSL_CTX *serverctx, SSL_CTX *clientctx, SSL **sssl,
 
     if (SSL_is_dtls(clientssl)) {
         s_to_c_bio = BIO_new(bio_s_mempacket_test());
-        c_to_s_bio = BIO_new(bio_s_mempacket_test());;
+        c_to_s_bio = BIO_new(bio_s_mempacket_test());
     } else {
         s_to_c_bio = BIO_new(BIO_s_mem());
         c_to_s_bio = BIO_new(BIO_s_mem());


More information about the openssl-commits mailing list