From 9af00170771fe010df1bab2501fcbfb98ebfc5e0 Mon Sep 17 00:00:00 2001 From: Lucas Tanure Date: Mon, 21 Sep 2015 11:24:35 -0300 Subject: [PATCH] ivi-layout-transition: Fix potential leak of memory pointed to by transition Free transition before return. We don't need to use layout_transition_destroy, because transition was not registered yet. v2: consolidate memory leaks fixes Signed-off-by: Lucas Tanure Reviewed-by: Bryce Harrington --- ivi-shell/ivi-layout-transition.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ivi-shell/ivi-layout-transition.c b/ivi-shell/ivi-layout-transition.c index d12a8f40..6370e8f6 100644 --- a/ivi-shell/ivi-layout-transition.c +++ b/ivi-shell/ivi-layout-transition.c @@ -340,6 +340,7 @@ create_move_resize_view_transition( data = malloc(sizeof(*data)); if (data == NULL) { weston_log("%s: memory allocation fails\n", __func__); + free(transition); return NULL; } @@ -468,6 +469,7 @@ create_fade_view_transition( data = malloc(sizeof(*data)); if (data == NULL) { weston_log("%s: memory allocation fails\n", __func__); + free(transition); return NULL; } @@ -697,6 +699,7 @@ create_move_layer_transition( data = malloc(sizeof(*data)); if (data == NULL) { weston_log("%s: memory allocation fails\n", __func__); + free(transition); return NULL; }