don't let BN_CTX_free(NULL) segfault
This commit is contained in:
parent
e3d0e0a792
commit
c1a8a5de13
1 changed files with 4 additions and 0 deletions
|
@ -230,7 +230,10 @@ BN_CTX *BN_CTX_new(void)
|
|||
|
||||
void BN_CTX_free(BN_CTX *ctx)
|
||||
{
|
||||
if (ctx == NULL)
|
||||
return;
|
||||
#ifdef BN_CTX_DEBUG
|
||||
{
|
||||
BN_POOL_ITEM *pool = ctx->pool.head;
|
||||
fprintf(stderr,"BN_CTX_free, stack-size=%d, pool-bignums=%d\n",
|
||||
ctx->stack.size, ctx->pool.size);
|
||||
|
@ -242,6 +245,7 @@ void BN_CTX_free(BN_CTX *ctx)
|
|||
pool = pool->next;
|
||||
}
|
||||
fprintf(stderr,"\n");
|
||||
}
|
||||
#endif
|
||||
BN_STACK_finish(&ctx->stack);
|
||||
BN_POOL_finish(&ctx->pool);
|
||||
|
|
Loading…
Reference in a new issue