mirror of
https://github.com/openssl/openssl.git
synced 2024-12-01 05:55:11 +08:00
test: fix coverity 1475941: resource leak
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14769)
This commit is contained in:
parent
ccf19c23c0
commit
97ef45ea13
@ -257,8 +257,10 @@ static int dh_computekey_range_test(void)
|
||||
goto err;
|
||||
|
||||
if (!TEST_true(BN_set_word(priv, 1))
|
||||
|| !TEST_true(DH_set0_key(dh, NULL, priv))
|
||||
|| !TEST_true(BN_set_word(pub, 1)))
|
||||
|| !TEST_true(DH_set0_key(dh, NULL, priv)))
|
||||
goto err;
|
||||
priv = NULL;
|
||||
if (!TEST_true(BN_set_word(pub, 1)))
|
||||
goto err;
|
||||
|
||||
/* Given z = pub ^ priv mod p */
|
||||
@ -282,6 +284,7 @@ static int dh_computekey_range_test(void)
|
||||
ret = 1;
|
||||
err:
|
||||
OPENSSL_free(buf);
|
||||
BN_free(priv);
|
||||
BN_free(pub);
|
||||
BN_free(g);
|
||||
BN_free(q);
|
||||
|
Loading…
Reference in New Issue
Block a user