[PATCH][weston 1/3] ivi-layout-transition: Fix potential leak of memory pointed to by transition

Lucas Tanure tanure at linux.com
Wed Sep 23 06:33:21 PDT 2015


Free transition in ivi_layout_transition_fade_layer if we fail to
allocate memory for data

Signed-off-by: Lucas Tanure <tanure at linux.com>
---
 ivi-shell/ivi-layout-transition.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ivi-shell/ivi-layout-transition.c b/ivi-shell/ivi-layout-transition.c
index 150e301..716dd70 100644
--- a/ivi-shell/ivi-layout-transition.c
+++ b/ivi-shell/ivi-layout-transition.c
@@ -850,6 +850,7 @@ ivi_layout_transition_fade_layer(
 	data = malloc(sizeof(*data));
 	if (data == NULL) {
 		weston_log("%s: memory allocation fails\n", __func__);
+		free(transition);
 		return;
 	}
 
-- 
2.5.3



More information about the wayland-devel mailing list