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

Bryce Harrington bryce at osg.samsung.com
Wed Sep 23 17:01:44 PDT 2015


On Wed, Sep 23, 2015 at 10:33:23AM -0300, Lucas Tanure wrote:
> Destroy transition if layout_transition_register was not ok, we can't
> just free transition, we need to call layout_transition_destroy in order
> to free private_data from 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 507de6d..7b17544 100644
> --- a/ivi-shell/ivi-layout-transition.c
> +++ b/ivi-shell/ivi-layout-transition.c
> @@ -873,7 +873,8 @@ ivi_layout_transition_fade_layer(
>  	data->end_alpha = end_alpha;
>  	data->destroy_func = destroy_func;
>  
> -	layout_transition_register(transition);
> +	if(!layout_transition_register(transition))
> +		layout_transition_destroy(transition)

Missing a semi-colon ^^

Bryce

>  
>  	return;
>  }
> -- 
> 2.5.3
> 
> _______________________________________________
> 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