Allow NULL for some _free routines.
[openssl.git] / crypto / comp / comp_lib.c
index 5bed1876a80e55098cc865a90d7b055434910cd0..c199bb352f139f9a5768402cf9a07cdfd245b709 100644 (file)
@@ -45,6 +45,8 @@ const char *COMP_get_name(const COMP_METHOD *meth)
 
 void COMP_CTX_free(COMP_CTX *ctx)
 {
+    if (ctx == NULL)
+        return;
     if (ctx->meth->finish != NULL)
         ctx->meth->finish(ctx);