update to 2.7
[pve-qemu-kvm.git] / debian / patches / extra / CVE-2016-7994-virtio-gpu-fix-memory-leak-in-virtio_gpu_resource_cr.patch
blobcddc70f7df09db5766f2866c3f69f9d88e70e7c0
1 From 594fa98211f92ab07ee6d6b6a9eda93a416a1f57 Mon Sep 17 00:00:00 2001
2 From: Li Qiang <liqiang6-s@360.cn>
3 Date: Sun, 18 Sep 2016 19:07:11 -0700
4 Subject: [PATCH 1/2] virtio-gpu: fix memory leak in
5 virtio_gpu_resource_create_2d
7 In virtio gpu resource create dispatch, if the pixman format is zero
8 it doesn't free the resource object allocated previously. Thus leading
9 a host memory leak issue. This patch avoid this.
11 Signed-off-by: Li Qiang <liqiang6-s@360.cn>
12 ---
13 hw/display/virtio-gpu.c | 1 +
14 1 file changed, 1 insertion(+)
16 diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
17 index 7fe6ed8..5b6d17b 100644
18 --- a/hw/display/virtio-gpu.c
19 +++ b/hw/display/virtio-gpu.c
20 @@ -333,6 +333,7 @@ static void virtio_gpu_resource_create_2d(VirtIOGPU *g,
21 qemu_log_mask(LOG_GUEST_ERROR,
22 "%s: host couldn't handle guest format %d\n",
23 __func__, c2d.format);
24 + g_free(res);
25 cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER;
26 return;
28 --
29 2.1.4