isl_hmap_map_basic_set_set: avoid memory leak on error path
[platform/upstream/isl.git] / closure.c
index 8655695..a0faa15 100644 (file)
--- a/closure.c
+++ b/closure.c
@@ -1,14 +1,21 @@
-#include <isl_map.h>
+#include <assert.h>
+#include <isl/map.h>
+#include <isl/options.h>
 
 int main(int argc, char **argv)
 {
        struct isl_ctx *ctx;
        struct isl_map *map;
+       struct isl_options *options;
        int exact;
 
-       ctx = isl_ctx_alloc();
+       options = isl_options_new_with_defaults();
+       assert(options);
+       argc = isl_options_parse(options, argc, argv, ISL_ARG_ALL);
 
-       map = isl_map_read_from_file(ctx, stdin, -1);
+       ctx = isl_ctx_alloc_with_options(&isl_options_args, options);
+
+       map = isl_map_read_from_file(ctx, stdin);
        map = isl_map_transitive_closure(map, &exact);
        if (!exact)
                printf("# NOT exact\n");