diff options
author | Peiwei Hu <jlu.hpw@foxmail.com> | 2021-12-15 10:46:04 +0100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2021-12-17 08:58:19 +0100 |
commit | ec9135a62320c861ab17f7179ebe470686360c64 (patch) | |
tree | 78ef974622207f96e04aee48ea40ac26ffd80818 /test/acvp_test.c | |
parent | test/cmp_vfy_test.c: free before return (diff) | |
download | openssl-ec9135a62320c861ab17f7179ebe470686360c64.tar.xz openssl-ec9135a62320c861ab17f7179ebe470686360c64.zip |
get_ecdsa_sig_rs_bytes: free value of d2i_ECDSA_SIG() before return
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17280)
Diffstat (limited to 'test/acvp_test.c')
-rw-r--r-- | test/acvp_test.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/acvp_test.c b/test/acvp_test.c index d8425f0d20..bbc77d0ae6 100644 --- a/test/acvp_test.c +++ b/test/acvp_test.c @@ -218,7 +218,7 @@ static int get_ecdsa_sig_rs_bytes(const unsigned char *sig, size_t sig_len, r1 = ECDSA_SIG_get0_r(sign); s1 = ECDSA_SIG_get0_s(sign); if (r1 == NULL || s1 == NULL) - return 0; + goto err; r1_len = BN_num_bytes(r1); s1_len = BN_num_bytes(s1); @@ -560,7 +560,7 @@ static int get_dsa_sig_rs_bytes(const unsigned char *sig, size_t sig_len, return 0; DSA_SIG_get0(sign, &r1, &s1); if (r1 == NULL || s1 == NULL) - return 0; + goto err; r1_len = BN_num_bytes(r1); s1_len = BN_num_bytes(s1); |