[Libva] [PATCH 1/6] Fix memory leak issue in open_display func

Xiang, Haihao haihao.xiang at intel.com
Fri Jul 22 08:14:20 UTC 2016


Applied this series of patches.

Thanks
Haihao


> If the !d->display is true, will exit without free memory
> block allocate for 'd'.
> 
> Signed-off-by: Lim Siew Hoon <siew.hoon.lim at intel.com>
> ---
>  test/putsurface/putsurface_wayland.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/test/putsurface/putsurface_wayland.c
> b/test/putsurface/putsurface_wayland.c
> index b93334d..c3b504f 100644
> --- a/test/putsurface/putsurface_wayland.c
> +++ b/test/putsurface/putsurface_wayland.c
> @@ -207,8 +207,10 @@ open_display(void)
>          return NULL;
>  
>      d->display = wl_display_connect(NULL);
> -    if (!d->display)
> +    if (!d->display){
> +        free(d);
>          return NULL;
> +    }
>  
>      wl_display_set_user_data(d->display, d);
>      d->registry = wl_display_get_registry(d->display);


More information about the Libva mailing list