isl_convex_hull.c: compute_facet: avoid double free on error path
authorSven Verdoolaege <skimo@kotnet.org>
Thu, 1 Jan 2015 14:51:36 +0000 (1 15:51 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Thu, 1 Jan 2015 23:33:22 +0000 (2 00:33 +0100)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_convex_hull.c

index b1254be..1e8d168 100644 (file)
@@ -595,8 +595,9 @@ static struct isl_basic_set *compute_facet(struct isl_set *set, isl_int *c)
        set = isl_set_preimage(set, U);
        facet = uset_convex_hull_wrap_bounded(set);
        facet = isl_basic_set_preimage(facet, Q);
-       if (facet)
-               isl_assert(ctx, facet->n_eq == 0, goto error);
+       if (facet && facet->n_eq != 0)
+               isl_die(ctx, isl_error_internal, "unexpected equality",
+                       return isl_basic_set_free(facet));
        return facet;
 error:
        isl_basic_set_free(facet);