From 33821f9d1f49922982fe9acefabad1c82956ce6a Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Fri, 5 Jul 2013 18:26:31 +0200 Subject: [PATCH] isl_mat_sub_alloc6: accept NULL pointer on zero-size allocation Signed-off-by: Sven Verdoolaege --- isl_mat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/isl_mat.c b/isl_mat.c index 616eb617..292264ce 100644 --- a/isl_mat.c +++ b/isl_mat.c @@ -123,7 +123,7 @@ __isl_give isl_mat *isl_mat_sub_alloc6(isl_ctx *ctx, isl_int **row, if (!mat) return NULL; mat->row = isl_alloc_array(ctx, isl_int *, n_row); - if (!mat->row) + if (n_row && !mat->row) goto error; for (i = 0; i < n_row; ++i) mat->row[i] = row[first_row+i] + first_col; -- 2.11.4.GIT