[PATCH] ui/dbus-listener: Fix FBO leak in dbus_cursor_dmabuf

marcandre.lureau@redhat.com posted 1 patch 1 month, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260303163943.153613-1-marcandre.lureau@redhat.com
Maintainers: "Marc-André Lureau" <marcandre.lureau@redhat.com>
ui/dbus-listener.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] ui/dbus-listener: Fix FBO leak in dbus_cursor_dmabuf
Posted by marcandre.lureau@redhat.com 1 month, 1 week ago
From: Marc-André Lureau <marcandre.lureau@redhat.com>

cursor_fb is a local egl_fb that gets an FBO allocated via
egl_fb_setup_for_tex but is never destroyed, leaking the
framebuffer object on every cursor update.

Add egl_fb_destroy() after the cursor data has been read.

Fixes: commit 142ca628a7 ("ui: add a D-Bus display backend")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 ui/dbus-listener.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c
index 3e2b4adf41f..fff7cf83274 100644
--- a/ui/dbus-listener.c
+++ b/ui/dbus-listener.c
@@ -660,6 +660,7 @@ static void dbus_cursor_dmabuf(DisplayChangeListener *dcl,
     egl_fb_setup_for_tex(&cursor_fb, width, height, texture, false);
     ds = qemu_create_displaysurface(width, height);
     egl_fb_read(ds, &cursor_fb);
+    egl_fb_destroy(&cursor_fb);
 
     v_data = g_variant_new_from_data(
         G_VARIANT_TYPE("ay"),
-- 
2.53.0