[PATCH weston] compositor-wayland: Properly dealloc mmap data using munmap

Quentin Glidic sardemff7+wayland at sardemff7.net
Thu Mar 30 23:39:57 UTC 2017


On 3/29/17 10:23 PM, Raúl Peñacoba wrote:
> Signed-off-by: Raúl Peñacoba <raul.mikaop.zelda at gmail.com>

Really nice catch:
Reviewed-by: Quentin Glidic <sardemff7+git at sardemff7.net>

And pushed:
745e647f..fec723ef  master -> master

Thanks,


> ---
>   libweston/compositor-wayland.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libweston/compositor-wayland.c b/libweston/compositor-wayland.c
> index a76dd08e..14f2c8db 100644
> --- a/libweston/compositor-wayland.c
> +++ b/libweston/compositor-wayland.c
> @@ -301,7 +301,7 @@ wayland_output_get_shm_buffer(struct wayland_output *output)
>   	if (sb == NULL) {
>   		weston_log("could not zalloc %zu memory for sb: %m\n", sizeof *sb);
>   		close(fd);
> -		free(data);
> +		munmap(data, height * stride);
>   		return NULL;
>   	}
>   
> 


-- 

Quentin “Sardem FF7” Glidic


More information about the wayland-devel mailing list