From: Sven Verdoolaege Date: Tue, 30 Jul 2013 12:50:56 +0000 (+0200) Subject: isl_union_map_params: plug memory leak in case of empty input X-Git-Tag: isl-0.12.2~16 X-Git-Url: https://repo.or.cz/w/isl.git/commitdiff_plain/58bfdff78c21f4eb4baf2450748415a90783c1e9 isl_union_map_params: plug memory leak in case of empty input Signed-off-by: Sven Verdoolaege --- diff --git a/isl_union_map.c b/isl_union_map.c index 32a86fdd..ce07ac5d 100644 --- a/isl_union_map.c +++ b/isl_union_map.c @@ -1677,8 +1677,12 @@ __isl_give isl_set *isl_union_map_params(__isl_take isl_union_map *umap) empty = isl_union_map_is_empty(umap); if (empty < 0) return isl_union_map_free(umap); - if (empty) - return isl_set_empty(isl_union_map_get_space(umap)); + if (empty) { + isl_space *space; + space = isl_union_map_get_space(umap); + isl_union_map_free(umap); + return isl_set_empty(space); + } return isl_set_from_union_set(cond_un_op(umap, ¶ms_entry)); }