summaryrefslogtreecommitdiff
path: root/isl_mat.c
diff options
context:
space:
mode:
authorSven Verdoolaege <skimo@kotnet.org>2010-05-12 11:33:33 +0200
committerSven Verdoolaege <skimo@kotnet.org>2010-05-13 18:53:54 +0200
commitc9c6724ca91df2ef1819e5c9f55a8ceef2588daa (patch)
tree6e3eebf64a83418b7d462c9e8f6abcdc484c0189 /isl_mat.c
parent9e726edec7035480c65e1bda1b2639a961cb89e4 (diff)
downloadisl-c9c6724ca91df2ef1819e5c9f55a8ceef2588daa.tar.gz
isl-c9c6724ca91df2ef1819e5c9f55a8ceef2588daa.tar.bz2
isl-c9c6724ca91df2ef1819e5c9f55a8ceef2588daa.zip
isl_mat_lin_to_aff: fix error handling
Diffstat (limited to 'isl_mat.c')
-rw-r--r--isl_mat.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/isl_mat.c b/isl_mat.c
index 6f4f889a..244eb0cf 100644
--- a/isl_mat.c
+++ b/isl_mat.c
@@ -523,7 +523,7 @@ struct isl_mat *isl_mat_lin_to_aff(struct isl_mat *mat)
return NULL;
mat2 = isl_mat_alloc(mat->ctx, 1+mat->n_row, 1+mat->n_col);
if (!mat2)
- return NULL;
+ goto error;
isl_int_set_si(mat2->row[0][0], 1);
isl_seq_clr(mat2->row[0]+1, mat->n_col);
for (i = 0; i < mat->n_row; ++i) {
@@ -532,6 +532,9 @@ struct isl_mat *isl_mat_lin_to_aff(struct isl_mat *mat)
}
isl_mat_free(mat);
return mat2;
+error:
+ isl_mat_free(mat);
+ return NULL;
}
static int row_first_non_zero(isl_int **row, unsigned n_row, unsigned col)