isl_space_extend: avoid invalid access on error
authorSven Verdoolaege <skimo@kotnet.org>
Sun, 2 Dec 2012 11:23:02 +0000 (12:23 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Sun, 2 Dec 2012 11:23:45 +0000 (12:23 +0100)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_space.c

index bd7d15c..b0aca35 100644 (file)
@@ -783,6 +783,8 @@ __isl_give isl_space *isl_space_extend(__isl_take isl_space *dim,
        isl_assert(dim->ctx, dim->n_out <= n_out, goto error);
 
        dim = isl_space_cow(dim);
+       if (!dim)
+               goto error;
 
        if (dim->ids) {
                ids = isl_calloc_array(dim->ctx, isl_id *,