diff --git a/crypto/fipsmodule/bn/bn.c b/crypto/fipsmodule/bn/bn.c index e3f1c9007..4bed2d339 100644 --- a/crypto/fipsmodule/bn/bn.c +++ b/crypto/fipsmodule/bn/bn.c @@ -101,26 +101,7 @@ void BN_free(BIGNUM *bn) { } void BN_clear_free(BIGNUM *bn) { - char should_free; - - if (bn == NULL) { - return; - } - - if (bn->d != NULL) { - if ((bn->flags & BN_FLG_STATIC_DATA) == 0) { - OPENSSL_free(bn->d); - } else { - OPENSSL_cleanse(bn->d, bn->dmax * sizeof(bn->d[0])); - } - } - - should_free = (bn->flags & BN_FLG_MALLOCED) != 0; - if (should_free) { - OPENSSL_free(bn); - } else { - OPENSSL_cleanse(bn, sizeof(BIGNUM)); - } + BN_free(bn); } BIGNUM *BN_dup(const BIGNUM *src) {