[openssl-commits] [openssl] OpenSSL_1_0_2-stable update

Rich Salz rsalz at openssl.org
Tue Jun 23 12:04:26 UTC 2015


The branch OpenSSL_1_0_2-stable has been updated
       via  295c629ab1676647c53166db96657e1fccad1508 (commit)
      from  c61bb1abafaaa90a475fb0be87bdde1a21b7677b (commit)


- Log -----------------------------------------------------------------
commit 295c629ab1676647c53166db96657e1fccad1508
Author: Russell Webb <russell.webb at intel.com>
Date:   Sat Jun 13 10:35:55 2015 -0400

    RT3856: Fix memory leaks in test code
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    (cherry picked from commit 2d540402aac7a05af9c99b58864d53c0201a0b42)

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

Summary of changes:
 crypto/bn/bntest.c     | 3 +--
 crypto/hmac/hmactest.c | 3 +++
 crypto/srp/srptest.c   | 1 +
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/crypto/bn/bntest.c b/crypto/bn/bntest.c
index 06662c5..470d5da 100644
--- a/crypto/bn/bntest.c
+++ b/crypto/bn/bntest.c
@@ -1042,7 +1042,6 @@ int test_mod_exp_mont_consttime(BIO *bp, BN_CTX *ctx)
 int test_mod_exp_mont5(BIO *bp, BN_CTX *ctx)
 {
     BIGNUM *a, *p, *m, *d, *e;
-
     BN_MONT_CTX *mont;
 
     a = BN_new();
@@ -1050,7 +1049,6 @@ int test_mod_exp_mont5(BIO *bp, BN_CTX *ctx)
     m = BN_new();
     d = BN_new();
     e = BN_new();
-
     mont = BN_MONT_CTX_new();
 
     BN_bntest_rand(m, 1024, 0, 1); /* must be odd for montgomery */
@@ -1099,6 +1097,7 @@ int test_mod_exp_mont5(BIO *bp, BN_CTX *ctx)
         fprintf(stderr, "Modular exponentiation test failed!\n");
         return 0;
     }
+    BN_MONT_CTX_free(mont);
     BN_free(a);
     BN_free(p);
     BN_free(m);
diff --git a/crypto/hmac/hmactest.c b/crypto/hmac/hmactest.c
index 271d0eb..5a57395 100644
--- a/crypto/hmac/hmactest.c
+++ b/crypto/hmac/hmactest.c
@@ -195,6 +195,7 @@ int main(int argc, char *argv[])
     }
     printf("test 4 ok\n");
 test5:
+    HMAC_CTX_cleanup(&ctx);
     HMAC_CTX_init(&ctx);
     if (HMAC_Init_ex(&ctx, test[4].key, test[4].key_len, NULL, NULL)) {
         printf("Should fail to initialise HMAC with empty MD (test 5)\n");
@@ -284,6 +285,7 @@ test5:
         printf("test 5 ok\n");
     }
 test6:
+    HMAC_CTX_cleanup(&ctx);
     HMAC_CTX_init(&ctx);
     if (!HMAC_Init_ex(&ctx, test[7].key, test[7].key_len, EVP_sha1(), NULL)) {
         printf("Failed to initialise HMAC (test 6)\n");
@@ -314,6 +316,7 @@ test6:
         printf("test 6 ok\n");
     }
 end:
+    HMAC_CTX_cleanup(&ctx);
     EXIT(err);
     return (0);
 }
diff --git a/crypto/srp/srptest.c b/crypto/srp/srptest.c
index 451c70e..00e001b 100644
--- a/crypto/srp/srptest.c
+++ b/crypto/srp/srptest.c
@@ -148,6 +148,7 @@ int main(int argc, char **argv)
     ERR_remove_thread_state(NULL);
     ERR_free_strings();
     CRYPTO_mem_leaks(bio_err);
+    BIO_free(bio_err);
 
     return 0;
 }


More information about the openssl-commits mailing list