From db95aa6cb9dd926ef2c119072410b33d1b460c6e Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Wed, 5 Jun 2013 09:54:18 +0200 Subject: [PATCH] isl_union_map_alloc: avoid double free on error path Signed-off-by: Sven Verdoolaege --- isl_union_map.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/isl_union_map.c b/isl_union_map.c index 1528ebd8..0f7a9ce9 100644 --- a/isl_union_map.c +++ b/isl_union_map.c @@ -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) -- 2.11.4.GIT