The branch master has been updated
       via  563c1ec61848073e3739dd126cf1950e338c820d (commit)
      from  28e90f69fbcdcd3c06359a53adceb2dbdfaba614 (commit)


- Log -----------------------------------------------------------------
commit 563c1ec61848073e3739dd126cf1950e338c820d
Author: Miroslav Franc <[email protected]>
Date:   Thu Jul 14 17:14:08 2016 +0200

    fix memory leaks
    
    Reviewed-by: Kurt Roeckx <[email protected]>
    Reviewed-by: Rich Salz <[email protected]>
    (Merged from https://github.com/openssl/openssl/pull/1313)

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

Summary of changes:
 crypto/ec/ecp_mont.c | 1 +
 ssl/ssl_rsa.c        | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/crypto/ec/ecp_mont.c b/crypto/ec/ecp_mont.c
index a9c6040..994cc1d 100644
--- a/crypto/ec/ecp_mont.c
+++ b/crypto/ec/ecp_mont.c
@@ -178,6 +178,7 @@ int ec_GFp_mont_group_set_curve(EC_GROUP *group, const 
BIGNUM *p,
     }
 
  err:
+    BN_free(one);
     BN_CTX_free(new_ctx);
     BN_MONT_CTX_free(mont);
     return ret;
diff --git a/ssl/ssl_rsa.c b/ssl/ssl_rsa.c
index aad65ea..bb4e872 100644
--- a/ssl/ssl_rsa.c
+++ b/ssl/ssl_rsa.c
@@ -110,6 +110,7 @@ int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa)
     RSA_up_ref(rsa);
     if (EVP_PKEY_assign_RSA(pkey, rsa) <= 0) {
         RSA_free(rsa);
+        EVP_PKEY_free(pkey);
         return 0;
     }
 
@@ -452,6 +453,7 @@ int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa)
     RSA_up_ref(rsa);
     if (EVP_PKEY_assign_RSA(pkey, rsa) <= 0) {
         RSA_free(rsa);
+        EVP_PKEY_free(pkey);
         return 0;
     }
 
_____
openssl-commits mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits

Reply via email to