[openssl] master update

tomas at openssl.org tomas at openssl.org
Fri Oct 15 06:55:14 UTC 2021


The branch master has been updated
       via  34563be5368fb8e6ade7d06d8376522ba83cd6ac (commit)
      from  73970cb91fdf8e7b4b434d479b875a47a0aa0dbc (commit)


- Log -----------------------------------------------------------------
commit 34563be5368fb8e6ade7d06d8376522ba83cd6ac
Author: Peiwei Hu <jlu.hpw at foxmail.com>
Date:   Tue Oct 12 10:50:12 2021 +0800

    test/ssl_old_test.c: Fix potential leak
    
    Reviewed-by: Kurt Roeckx <kurt at roeckx.be>
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/16806)

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

Summary of changes:
 test/ssl_old_test.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/test/ssl_old_test.c b/test/ssl_old_test.c
index 60a275a014..3ccc8e06e4 100644
--- a/test/ssl_old_test.c
+++ b/test/ssl_old_test.c
@@ -829,12 +829,14 @@ static SSL_SESSION *read_session(const char *filename)
 
 static int write_session(const char *filename, SSL_SESSION *sess)
 {
-    BIO *f = BIO_new_file(filename, "w");
+    BIO *f;
 
     if (sess == NULL) {
         BIO_printf(bio_err, "No session information\n");
         return 0;
     }
+
+    f = BIO_new_file(filename, "w");
     if (f == NULL) {
         BIO_printf(bio_err, "Can't open session file %s\n", filename);
         ERR_print_errors(bio_err);


More information about the openssl-commits mailing list