提交 7534d131 编写于 作者: B Bodo Möller

avoid potential spurious BN_free()

Submitted by: David Heine <dlheine@suif.Stanford.EDU>
上级 7f3c9036
......@@ -83,7 +83,8 @@ BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
goto end;
if (!BN_set_word(ret, BN_is_bit_set(a, 0)))
{
BN_free(ret);
if (ret != in)
BN_free(ret);
return NULL;
}
bn_check_top(ret);
......@@ -102,7 +103,8 @@ BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
goto end;
if (!BN_set_word(ret, BN_is_one(a)))
{
BN_free(ret);
if (ret != in)
BN_free(ret);
return NULL;
}
bn_check_top(ret);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册