Allow NULL for some _free routines.
[openssl.git] / crypto / bn / bn_ctx.c
index 7202aef326d336c346f35d38559a40ed9ffb5b31..68c04687437f1d9fdf7971adb60fa68399d57d38 100644 (file)
@@ -156,6 +156,8 @@ BN_CTX *BN_CTX_secure_new(void)
 
 void BN_CTX_free(BN_CTX *ctx)
 {
+    if (ctx == NULL)
+        return;
 #ifdef BN_CTX_DEBUG
     {
         BN_POOL_ITEM *pool = ctx->pool.head;