summaryrefslogtreecommitdiff
path: root/isl_tab_pip.c
diff options
context:
space:
mode:
authorSven Verdoolaege <skimo@kotnet.org>2010-06-25 20:55:12 +0200
committerSven Verdoolaege <skimo@kotnet.org>2010-06-26 17:37:39 +0200
commitc266d821693f7c6b9ff24e73a4b5f661108a019d (patch)
tree62a971428298e387e09708912e877c9f0426fa7b /isl_tab_pip.c
parentc1f805bb0ed54dd712e04b666bb8f40407ee936c (diff)
downloadisl-c266d821693f7c6b9ff24e73a4b5f661108a019d.tar.gz
isl-c266d821693f7c6b9ff24e73a4b5f661108a019d.tar.bz2
isl-c266d821693f7c6b9ff24e73a4b5f661108a019d.zip
isl_tab_pip.c: sol_map_init: avoid NULL pointer dereference
Diffstat (limited to 'isl_tab_pip.c')
-rw-r--r--isl_tab_pip.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/isl_tab_pip.c b/isl_tab_pip.c
index b616a335..41319fea 100644
--- a/isl_tab_pip.c
+++ b/isl_tab_pip.c
@@ -505,6 +505,8 @@ struct isl_sol_map {
static void sol_map_free(struct isl_sol_map *sol_map)
{
+ if (!sol_map)
+ return;
if (sol_map->sol.context)
sol_map->sol.context->op->free(sol_map->sol.context);
isl_map_free(sol_map->map);
@@ -3210,7 +3212,10 @@ static struct isl_context *isl_context_alloc(struct isl_basic_set *dom)
static struct isl_sol_map *sol_map_init(struct isl_basic_map *bmap,
struct isl_basic_set *dom, int track_empty, int max)
{
- struct isl_sol_map *sol_map;
+ struct isl_sol_map *sol_map = NULL;
+
+ if (!bmap)
+ goto error;
sol_map = isl_calloc_type(bmap->ctx, struct isl_sol_map);
if (!sol_map)