wayland: Fix small leak of wl_registry on VADisplay

The struct wl_registry is created with wl_proxy_marshal_constructor()
while calling wl_display_get_registry() and must be freed wtih
wl_proxy_destroy() by calling wl_registry_destroy().

72 bytes in 1 blocks are definitely lost in loss record 6 of 10
   at 0x4C2EF35: calloc (in vgpreload_memcheck-amd64-linux.so)
   by 0x5FD7503: ??? (in libwayland-client.so.0.3.0)
   by 0x5FD7A26: wl_proxy_marshal_array_constructor_versioned
   by 0x5FD7D7B: wl_proxy_marshal_constructor
   by 0x10B096: wl_display_get_registry (wayland-client-protocol.h:966)
   by 0x10AD72: va_open_display_wayland (va_display_wayland.c:91)
   by 0x10A43B: va_open_display (va_display.c:154)
   by 0x109B0A: main (vainfo.c:107)

Signed-off-by: Victor Toso <victortoso@redhat.com>
This commit is contained in:
Victor Toso 2017-12-17 07:46:46 +01:00 committed by U. Artie Eoff
parent f007a4fed6
commit a2cc4901a0
1 changed files with 5 additions and 0 deletions

View File

@ -127,6 +127,11 @@ va_close_display_wayland(VADisplay va_dpy)
d->compositor = NULL;
}
if (d->registry) {
wl_registry_destroy(d->registry);
d->registry = NULL;
}
if (d->display) {
wl_display_disconnect(d->display);
d->display = NULL;