fix error found by coverity: check if ctx is != NULL before calling BN_CTX_end()
[openssl.git] / crypto / ec / ec_check.c
index f22c564..0e316b4 100644 (file)
@@ -113,7 +113,8 @@ int EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx)
        ret = 1;
 
 err:
-       BN_CTX_end(ctx);
+       if (ctx != NULL)
+               BN_CTX_end(ctx);
        if (new_ctx != NULL)
                BN_CTX_free(new_ctx);
        if (point)