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>
diff --git a/common/va_display_wayland.c b/common/va_display_wayland.c
index abcb2b6..e647eb7 100644
--- a/common/va_display_wayland.c
+++ b/common/va_display_wayland.c
@@ -127,6 +127,11 @@
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;