[PATCH][weston] ivi-layout-transition: Standardize the check for layout_transition_register

Bryce Harrington bryce at osg.samsung.com
Wed Sep 30 12:29:38 PDT 2015


Thanks for following up on this.

On Wed, Sep 30, 2015 at 09:38:37AM -0300, Lucas Tanure wrote:
> 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 at linux.com>

Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>
Pushed to trunk:

To ssh://git.freedesktop.org/git/wayland/weston
   aa97478..a3377cd  master -> master

> ---
>  ivi-shell/ivi-layout-transition.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/ivi-shell/ivi-layout-transition.c b/ivi-shell/ivi-layout-transition.c
> index adaa543..483437d 100644
> --- a/ivi-shell/ivi-layout-transition.c
> +++ b/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,
>  		duration);
>  
> -	layout_transition_register(transition);
> +	if(transition && layout_transition_register(transition))
> +		return;
> +	layout_transition_destroy(transition);
>  }
>  
>  /* fade transition */
> @@ -512,8 +514,9 @@ create_visibility_transition(struct ivi_layout_surface *surface,
>  		destroy_func,
>  		duration);
>  
> -	if (!layout_transition_register(transition))
> -		layout_transition_destroy(transition);
> +	if (transition && layout_transition_register(transition))
> +		return;
> +	layout_transition_destroy(transition);
>  }
>  
>  static void
> -- 
> 2.6.0
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list