virtio-gpu: fix memory leak in virtio_gpu_resource_create_2d
PATCH 1/1 virtio-gpu: fix memory leak in virtio_gpu_resource_create_2d
From: Li Qiang <[email protected]>
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.
--- hw/display/virtio-gpu.c | 1 + 1 file changed, 1 insertion(+)
hw/display/virtio-gpu.c +1 -0
@@ -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 ; }
Signature · 1 line
1.8.3.1
Quoted 8 lines · Li Qiang
From: Li Qiang <[email protected]>
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 <[email protected]>
---
Quoted 19 lines
hw/display/virtio-gpu.c | 1 + 1 file changed, 1 insertion(+)hw/display/virtio-gpu.c +1
-1@@ -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
Quoted 1 line
--
Marc-André Lureau
Quoted 7 lines · Li Qiang
From: Li Qiang <[email protected]>
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 <[email protected]>
Added to vga queue.
thanks,
Gerd