isl_basic_map_align_divs: avoid invalid access on error path
authorSven Verdoolaege <skimo@kotnet.org>
Wed, 5 Jun 2013 07:52:33 +0000 (09:52 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Wed, 5 Jun 2013 07:52:33 +0000 (09:52 +0200)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_map.c

index 17915e1..9f201e8 100644 (file)
--- a/isl_map.c
+++ b/isl_map.c
@@ -7665,6 +7665,8 @@ struct isl_basic_map *isl_basic_map_align_divs(
 
        src = isl_basic_map_order_divs(src);
        dst = isl_basic_map_cow(dst);
+       if (!dst)
+               return NULL;
        dst = isl_basic_map_extend_space(dst, isl_space_copy(dst->dim),
                        src->n_div, 0, 2 * src->n_div);
        if (!dst)