avoid potential spurious BN_free()
Submitted by: David Heine <dlheine@suif.Stanford.EDU>
This commit is contained in:
parent
7f3c9036ea
commit
7534d131d6
@ -83,6 +83,7 @@ BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
|
|||||||
goto end;
|
goto end;
|
||||||
if (!BN_set_word(ret, BN_is_bit_set(a, 0)))
|
if (!BN_set_word(ret, BN_is_bit_set(a, 0)))
|
||||||
{
|
{
|
||||||
|
if (ret != in)
|
||||||
BN_free(ret);
|
BN_free(ret);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -102,6 +103,7 @@ BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
|
|||||||
goto end;
|
goto end;
|
||||||
if (!BN_set_word(ret, BN_is_one(a)))
|
if (!BN_set_word(ret, BN_is_one(a)))
|
||||||
{
|
{
|
||||||
|
if (ret != in)
|
||||||
BN_free(ret);
|
BN_free(ret);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user