ivi-layout-transition: Standardize the check for layout_transition_register

Check the return from layout_transition_register in order to fix
potential leak of memory pointed to by transition. And don't register a
null transition.

Signed-off-by: Lucas Tanure <tanure@linux.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
dev
Lucas Tanure 9 years ago committed by Bryce Harrington
parent aa9747833e
commit a3377cd114
  1. 7
      ivi-shell/ivi-layout-transition.c

@ -418,7 +418,9 @@ ivi_layout_transition_move_resize_view(struct ivi_layout_surface *surface,
transition_move_resize_view_destroy, transition_move_resize_view_destroy,
duration); duration);
layout_transition_register(transition); if(transition && layout_transition_register(transition))
return;
layout_transition_destroy(transition);
} }
/* fade transition */ /* fade transition */
@ -512,7 +514,8 @@ create_visibility_transition(struct ivi_layout_surface *surface,
destroy_func, destroy_func,
duration); duration);
if (!layout_transition_register(transition)) if (transition && layout_transition_register(transition))
return;
layout_transition_destroy(transition); layout_transition_destroy(transition);
} }

Loading…
Cancel
Save