All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] virtio-gpu: fix memory leak in update_cursor_data_virgl
@ 2016-11-01 11:06 Li Qiang
  2016-11-01 11:16 ` Gerd Hoffmann
  2016-11-01 11:17 ` Marc-André Lureau
  0 siblings, 2 replies; 3+ messages in thread
From: Li Qiang @ 2016-11-01 11:06 UTC (permalink / raw)
  To: kraxel, qemu-devel; +Cc: Li Qiang

From: Li Qiang <liqiang6-s@360.cn>

In update_cursor_data_virgl function, if the 'width'/ 'height'
is not equal to current cursor's width/height it will return
without free the 'data' allocated previously. This will lead
a memory leak issue. This patch fix this issue.

Signed-off-by: Li Qiang <liqiang6-s@360.cn>
---
 hw/display/virtio-gpu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index 60bce94..5f32e1a 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -84,6 +84,7 @@ static void update_cursor_data_virgl(VirtIOGPU *g,
 
     if (width != s->current_cursor->width ||
         height != s->current_cursor->height) {
+        free(data);
         return;
     }
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-01 11:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-01 11:06 [Qemu-devel] [PATCH] virtio-gpu: fix memory leak in update_cursor_data_virgl Li Qiang
2016-11-01 11:16 ` Gerd Hoffmann
2016-11-01 11:17 ` Marc-André Lureau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.