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

Bryce Harrington bryce at osg.samsung.com
Tue Sep 22 14:36:58 PDT 2015


On Mon, Sep 21, 2015 at 11:24:35AM -0300, Lucas Tanure wrote:
> Free transition before return. We don't need to use layout_transition_destroy,
> because transition was not registered yet.
> 
> v2: consolidate memory leaks fixes

LGTM.

Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>
 
> Signed-off-by: Lucas Tanure <tanure at linux.com>
> ---
>  ivi-shell/ivi-layout-transition.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/ivi-shell/ivi-layout-transition.c b/ivi-shell/ivi-layout-transition.c
> index d12a8f4..6370e8f 100644
> --- a/ivi-shell/ivi-layout-transition.c
> +++ b/ivi-shell/ivi-layout-transition.c
> @@ -340,6 +340,7 @@ create_move_resize_view_transition(
>  	data = malloc(sizeof(*data));
>  	if (data == NULL) {
>  		weston_log("%s: memory allocation fails\n", __func__);
> +		free(transition);
>  		return NULL;
>  	}
>  
> @@ -468,6 +469,7 @@ create_fade_view_transition(
>  	data = malloc(sizeof(*data));
>  	if (data == NULL) {
>  		weston_log("%s: memory allocation fails\n", __func__);
> +		free(transition);
>  		return NULL;
>  	}
>  
> @@ -697,6 +699,7 @@ create_move_layer_transition(
>  	data = malloc(sizeof(*data));
>  	if (data == NULL) {
>  		weston_log("%s: memory allocation fails\n", __func__);
> +		free(transition);
>  		return NULL;
>  	}
>  
> -- 
> 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