All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] virtio-gpu: fix memory leak in virtio_gpu_resource_create_2d
@ 2016-09-19  2:07 Li Qiang
  2016-09-19  7:47 ` Marc-André Lureau
  2016-10-26 12:52 ` Gerd Hoffmann
  0 siblings, 2 replies; 3+ messages in thread
From: Li Qiang @ 2016-09-19  2:07 UTC (permalink / raw)
  To: kraxel, qemu-devel; +Cc: Li Qiang

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

In virtio gpu resource create dispatch, if the pixman format is zero
it doesn't free the resource object allocated previously. Thus leading
a host memory leak issue. This patch avoid this.

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 7fe6ed8..5b6d17b 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -333,6 +333,7 @@ static void virtio_gpu_resource_create_2d(VirtIOGPU *g,
         qemu_log_mask(LOG_GUEST_ERROR,
                       "%s: host couldn't handle guest format %d\n",
                       __func__, c2d.format);
+        g_free(res);
         cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER;
         return;
     }
-- 
1.8.3.1

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

end of thread, other threads:[~2016-10-26 12:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-19  2:07 [Qemu-devel] [PATCH] virtio-gpu: fix memory leak in virtio_gpu_resource_create_2d Li Qiang
2016-09-19  7:47 ` Marc-André Lureau
2016-10-26 12:52 ` Gerd Hoffmann

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.