isl_union_map_params: plug memory leak in case of empty input
authorSven Verdoolaege <skimo@kotnet.org>
Tue, 30 Jul 2013 12:50:56 +0000 (30 14:50 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Tue, 30 Jul 2013 12:50:56 +0000 (30 14:50 +0200)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_union_map.c

index 32a86fd..ce07ac5 100644 (file)
@@ -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, &params_entry));
 }