handle the case when BN_new returns NULL
This commit is contained in:
parent
55b3c877c7
commit
58f0f52e67
@ -458,12 +458,20 @@ BIGNUM *bn_dup_expand(const BIGNUM *b, int words)
|
|||||||
if (a)
|
if (a)
|
||||||
{
|
{
|
||||||
r = BN_new();
|
r = BN_new();
|
||||||
r->top = b->top;
|
if (r)
|
||||||
r->dmax = words;
|
{
|
||||||
r->neg = b->neg;
|
r->top = b->top;
|
||||||
r->d = a;
|
r->dmax = words;
|
||||||
|
r->neg = b->neg;
|
||||||
|
r->d = a;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* r == NULL, BN_new failure */
|
||||||
|
OPENSSL_free(a);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* Otherwise, there was an error in allocation in
|
/* If a == NULL, there was an error in allocation in
|
||||||
internal_bn_expand(), and NULL should be returned */
|
internal_bn_expand(), and NULL should be returned */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user