From 9884b29bd76e1415b9d412ceb710cbf70123c28c Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Wed, 29 Nov 2017 12:48:31 +0100 Subject: [PATCH] gpu_group.c: populate_array_references: plug memory leak on error path Signed-off-by: Sven Verdoolaege --- gpu_group.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gpu_group.c b/gpu_group.c index 7ff788d..babecae 100644 --- a/gpu_group.c +++ b/gpu_group.c @@ -846,8 +846,10 @@ static int populate_array_references(struct gpu_local_array_info *local, map = isl_map_detect_equalities(map); group = isl_calloc_type(ctx, struct gpu_array_ref_group); - if (!group) + if (!group) { + isl_map_free(map); return -1; + } group->local_array = local; group->array = local->array; group->access = map; -- 2.11.4.GIT