From 21393d086c0cbcee543ada19fc06105dc23dad26 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Fri, 26 Feb 2016 12:18:03 +0100 Subject: [PATCH] pet_scop_from_pet_stmt: fix error handling Signed-off-by: Sven Verdoolaege --- scop.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scop.c b/scop.c index 2aa96f2..ad05baf 100644 --- a/scop.c +++ b/scop.c @@ -486,8 +486,10 @@ struct pet_scop *pet_scop_from_pet_stmt(__isl_take isl_space *space, isl_union_set *domain; isl_schedule *schedule; - if (!stmt) - space = isl_space_free(space); + if (!stmt) { + isl_space_free(space); + return NULL; + } set = pet_nested_remove_from_set(isl_set_copy(stmt->domain)); domain = isl_union_set_from_set(set); -- 2.11.4.GIT