isl_union_map_alloc: avoid double free on error path
authorSven Verdoolaege <skimo@kotnet.org>
Wed, 5 Jun 2013 07:54:18 +0000 (09:54 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Wed, 5 Jun 2013 07:54:18 +0000 (09:54 +0200)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_union_map.c

index 1528ebd..0f7a9ce 100644 (file)
@@ -51,13 +51,9 @@ static __isl_give isl_union_map *isl_union_map_alloc(__isl_take isl_space *dim,
        umap->ref = 1;
        umap->dim = dim;
        if (isl_hash_table_init(dim->ctx, &umap->table, size) < 0)
-               goto error;
+               return isl_union_map_free(umap);
 
        return umap;
-error:
-       isl_space_free(dim);
-       isl_union_map_free(umap);
-       return NULL;
 }
 
 __isl_give isl_union_map *isl_union_map_empty(__isl_take isl_space *dim)