Further improve/fix ec_GFp_simple_points_make_affine (ecp_smpl.c) and
[openssl.git] / crypto / ec / ecp_smpl.c
index f2cd6f7e55c9db5c2e82ab0d4386c81e53010415..77bf845bcb60bdc2ebd52f0c0411976474eb3742 100644 (file)
@@ -1311,8 +1311,8 @@ int ec_GFp_simple_points_make_affine(const EC_GROUP *group, size_t num, EC_POINT
                {
                for (i = 0; i < num; i++)
                        {
-                       if (prod_Z[i] != NULL)
-                               BN_clear_free(prod_Z[i]);
+                       if (prod_Z[i] == NULL) break;
+                       BN_clear_free(prod_Z[i]);
                        }
                OPENSSL_free(prod_Z);
                }