[openssl-commits] [openssl] OpenSSL_1_0_1-stable update

Kurt Roeckx kurt at openssl.org
Tue Dec 22 10:58:40 UTC 2015


The branch OpenSSL_1_0_1-stable has been updated
       via  1967199f9f8ed3faf376ddbb077f41551541f08a (commit)
      from  23a58779f53a9060c823d00d76b3070cad61d9a3 (commit)


- Log -----------------------------------------------------------------
commit 1967199f9f8ed3faf376ddbb077f41551541f08a
Author: David Benjamin <davidben at chromium.org>
Date:   Thu Dec 17 20:11:11 2015 +0100

    Fix memory leak in DSA redo case.
    
    Found by clang scan-build.
    
    Signed-off-by: Kurt Roeckx <kurt at roeckx.be>
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    
    RT: #4184, MR: #1496
    (cherry picked from commit 679d87515d23ca31491effdc264edc81c695a72a)

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

Summary of changes:
 crypto/dsa/dsa_ossl.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/crypto/dsa/dsa_ossl.c b/crypto/dsa/dsa_ossl.c
index 6edb26d..9a3772e 100644
--- a/crypto/dsa/dsa_ossl.c
+++ b/crypto/dsa/dsa_ossl.c
@@ -187,9 +187,6 @@ static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
     if (!BN_mod_mul(s, s, kinv, dsa->q, ctx))
         goto err;
 
-    ret = DSA_SIG_new();
-    if (ret == NULL)
-        goto err;
     /*
      * Redo if r or s is zero as required by FIPS 186-3: this is very
      * unlikely.
@@ -201,11 +198,14 @@ static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
         }
         goto redo;
     }
+    ret = DSA_SIG_new();
+    if (ret == NULL)
+        goto err;
     ret->r = r;
     ret->s = s;
 
  err:
-    if (!ret) {
+    if (ret == NULL) {
         DSAerr(DSA_F_DSA_DO_SIGN, reason);
         BN_free(r);
         BN_free(s);


More information about the openssl-commits mailing list