From: Marc-André Lureau <marcandre.lureau@redhat.com>
If the fwcfg is written several times (without surface being displayed
in the meantime), we may leak surfaces.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
hw/display/ramfb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/display/ramfb.c b/hw/display/ramfb.c
index 4cd90a9382..116d674348 100644
--- a/hw/display/ramfb.c
+++ b/hw/display/ramfb.c
@@ -100,6 +100,7 @@ static void ramfb_fw_cfg_write(void *dev, off_t offset, size_t len)
s->width = width;
s->height = height;
+ g_clear_pointer(&s->ds, qemu_free_displaysurface);
s->ds = surface;
}
--
2.41.0