[openssl-commits] [openssl] master update

Matt Caswell matt at openssl.org
Fri Jul 7 09:49:55 UTC 2017


The branch master has been updated
       via  9561e2a169f499f8346ffdd7541bc4e3d81d6711 (commit)
      from  4549ed12ec3337313c14815438fa9aee88bf1359 (commit)


- Log -----------------------------------------------------------------
commit 9561e2a169f499f8346ffdd7541bc4e3d81d6711
Author: Matt Caswell <matt at openssl.org>
Date:   Wed Jul 5 10:32:33 2017 +0100

    Fix memory leak when using PSK session files
    
    We were not freeing the session created when loading a PSK session file.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    Reviewed-by: Bernd Edlinger <bernd.edlinger at hotmail.de>
    (Merged from https://github.com/openssl/openssl/pull/3855)

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

Summary of changes:
 apps/s_client.c | 1 +
 apps/s_server.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/apps/s_client.c b/apps/s_client.c
index 56209ac..5525b31 100644
--- a/apps/s_client.c
+++ b/apps/s_client.c
@@ -3009,6 +3009,7 @@ int s_client_main(int argc, char **argv)
             print_stuff(bio_c_out, con, 1);
         SSL_free(con);
     }
+    SSL_SESSION_free(psksess);
 #if !defined(OPENSSL_NO_NEXTPROTONEG)
     OPENSSL_free(next_proto.data);
 #endif
diff --git a/apps/s_server.c b/apps/s_server.c
index 13cc7a1..8df767c 100644
--- a/apps/s_server.c
+++ b/apps/s_server.c
@@ -2104,6 +2104,7 @@ int s_server_main(int argc, char *argv[])
     ret = 0;
  end:
     SSL_CTX_free(ctx);
+    SSL_SESSION_free(psksess);
     set_keylog_file(NULL, NULL);
     X509_free(s_cert);
     sk_X509_CRL_pop_free(crls, X509_CRL_free);


More information about the openssl-commits mailing list