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

Lucas Tanure tanure at linux.com
Mon Sep 21 10:10:33 PDT 2015


Check if layout_transition_register worked, otherwise destroy transition

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

diff --git a/ivi-shell/ivi-layout-transition.c b/ivi-shell/ivi-layout-transition.c
index 8d477b4..b00b589 100644
--- a/ivi-shell/ivi-layout-transition.c
+++ b/ivi-shell/ivi-layout-transition.c
@@ -511,7 +511,8 @@ create_visibility_transition(struct ivi_layout_surface *surface,
 		destroy_func,
 		duration);
 
-	layout_transition_register(transition);
+	if(!layout_transition_register(transition))
+		layout_transition_destroy(transition);
 }
 
 static void
-- 
2.5.3



More information about the wayland-devel mailing list