diff options
author | Rich Salz <rsalz@openssl.org> | 2015-04-30 21:37:06 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-04-30 21:37:06 -0400 |
commit | 23a1d5e97cd543d2b8e1b01dbf0f619b2e5ce540 (patch) | |
tree | 2d9372864fc2b34939d21b3706768ec225c9548f /test/ecdhtest.c | |
parent | 34166d41892643a36ad2d1f53cc0025e2edc2a39 (diff) |
free NULL cleanup 7
This gets BN_.*free:
BN_BLINDING_free BN_CTX_free BN_FLG_FREE BN_GENCB_free
BN_MONT_CTX_free BN_RECP_CTX_free BN_clear_free BN_free BUF_MEM_free
Also fix a call to DSA_SIG_free to ccgost engine and remove some #ifdef'd
dead code in engines/e_ubsec.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'test/ecdhtest.c')
-rw-r--r-- | test/ecdhtest.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/test/ecdhtest.c b/test/ecdhtest.c index 5c451e52be..af124764c8 100644 --- a/test/ecdhtest.c +++ b/test/ecdhtest.c @@ -282,14 +282,10 @@ static int test_ecdh_curve(int nid, const char *text, BN_CTX *ctx, BIO *out) OPENSSL_free(abuf); if (bbuf != NULL) OPENSSL_free(bbuf); - if (x_a) - BN_free(x_a); - if (y_a) - BN_free(y_a); - if (x_b) - BN_free(x_b); - if (y_b) - BN_free(y_b); + BN_free(x_a); + BN_free(y_a); + BN_free(x_b); + BN_free(y_b); EC_KEY_free(b); EC_KEY_free(a); return (ret); @@ -390,8 +386,7 @@ static EC_KEY *mk_eckey(int nid, const unsigned char *p, size_t plen) goto err; ok = 1; err: - if (priv) - BN_clear_free(priv); + BN_clear_free(priv); EC_POINT_free(pub); if (ok) return k; @@ -526,8 +521,7 @@ int main(int argc, char *argv[]) err: ERR_print_errors_fp(stderr); - if (ctx) - BN_CTX_free(ctx); + BN_CTX_free(ctx); BIO_free(out); CRYPTO_cleanup_all_ex_data(); ERR_remove_thread_state(NULL); |