avoid potential spurious BN_free()
Submitted by: David Heine <dlheine@suif.Stanford.EDU>
This commit is contained in:
parent
0e441bc103
commit
9eaf7e14c7
1 changed files with 4 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue