scop.c: expr_collect_accesses: plug memory leak on error path
authorSven Verdoolaege <skimo@kotnet.org>
Thu, 29 Aug 2013 10:51:00 +0000 (29 12:51 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Wed, 18 Sep 2013 11:18:55 +0000 (18 13:18 +0200)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
scop.c

diff --git a/scop.c b/scop.c
index 636b7b2..c0ea003 100644 (file)
--- a/scop.c
+++ b/scop.c
@@ -3372,7 +3372,7 @@ static __isl_give isl_union_map *expr_collect_accesses(struct pet_expr *expr,
        isl_space *dim;
 
        if (!expr)
-               return NULL;
+               return isl_union_map_free(accesses);
 
        for (i = 0; i < expr->n_arg; ++i)
                accesses = expr_collect_accesses(expr->args[i],