[PATCH 03/10] clients: Don't leak "menu" on error path in clients/window.c

Pekka Paalanen ppaalanen at gmail.com
Sun Jul 8 00:25:48 PDT 2012


On Sun,  8 Jul 2012 03:03:40 +0200
Martin Olsson <martin at minimum.se> wrote:

> ---
>  clients/window.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/clients/window.c b/clients/window.c
> index 8f3c942..f81d06f 100644
> --- a/clients/window.c
> +++ b/clients/window.c
> @@ -3133,8 +3133,10 @@ window_show_menu(struct display *display,
>  		return;
>  
>  	window = window_create_internal(parent->display, parent, TYPE_MENU);
> -	if (!window)
> +	if (!window) {
> +		free(menu);
>  		return;
> +	}
>  
>  	menu->window = window;
>  	menu->widget = window_add_widget(menu->window, menu);
> -- 

Reviewed-by: Pekka Paalanen <ppaalanen at gmail.com>


Thanks,
pq


More information about the wayland-devel mailing list