diff options
author | Alessandro Ghedini <alessandro@ghedini.me> | 2015-10-08 14:38:57 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2015-10-23 19:52:08 +0200 |
commit | 3f6c7691870d1cd2ad0e0c83638cef3f35a0b548 (patch) | |
tree | f0dae5a5fabb3b68e94d748ca49f4262411fad7a /crypto/dsa | |
parent | 8acaabec429b39f9436f6a88006384d72d292539 (diff) |
Fix memory leaks and other mistakes on errors
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/dsa')
-rw-r--r-- | crypto/dsa/dsa_gen.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/dsa/dsa_gen.c b/crypto/dsa/dsa_gen.c index 056e50049d..562d0b58d4 100644 --- a/crypto/dsa/dsa_gen.c +++ b/crypto/dsa/dsa_gen.c @@ -142,14 +142,14 @@ int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits, memcpy(seed, seed_in, seed_len); } + if ((mont = BN_MONT_CTX_new()) == NULL) + goto err; + if ((ctx = BN_CTX_new()) == NULL) goto err; BN_CTX_start(ctx); - if ((mont = BN_MONT_CTX_new()) == NULL) - goto err; - r0 = BN_CTX_get(ctx); g = BN_CTX_get(ctx); W = BN_CTX_get(ctx); |