backend-wayland: fix memory leak in wayland_shm_buffer_attach

Since the pixman_region32_t damage is initialized unconditionally, also
finalize it unconditionally. Otherwise we leak rectangle memory when
sb->output->frame is NULL.

Reported-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
This commit is contained in:
Philipp Zabel 2023-06-09 10:50:53 +02:00 committed by Marius Vlad
parent 0d4c523c4c
commit 2c7dceced7

View file

@ -603,8 +603,7 @@ wayland_shm_buffer_attach(struct wayland_shm_buffer *sb)
rects[i].y1, rects[i].x2 - rects[i].x1,
rects[i].y2 - rects[i].y1);
if (sb->output->frame)
pixman_region32_fini(&damage);
pixman_region32_fini(&damage);
}
static int