diff options
Diffstat (limited to 'crypto/rsa/rsa_backend.c')
-rw-r--r-- | crypto/rsa/rsa_backend.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crypto/rsa/rsa_backend.c b/crypto/rsa/rsa_backend.c index b69c94fc11..bc658d9d30 100644 --- a/crypto/rsa/rsa_backend.c +++ b/crypto/rsa/rsa_backend.c @@ -49,9 +49,12 @@ static int collect_numbers(STACK_OF(BIGNUM) *numbers, if (p != NULL) { BIGNUM *tmp = NULL; - if (!OSSL_PARAM_get_BN(p, &tmp) - || sk_BIGNUM_push(numbers, tmp) == 0) + if (!OSSL_PARAM_get_BN(p, &tmp)) return 0; + if (sk_BIGNUM_push(numbers, tmp) == 0) { + BN_clear_free(tmp); + return 0; + } } } |