virtio-gpu: fix memory leak in update_cursor_data_virgl
PATCH 1/1 virtio-gpu: fix memory leak in update_cursor_data_virgl
From: Li Qiang <[email protected]>
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.
--- hw/display/virtio-gpu.c | 1 + 1 file changed, 1 insertion(+)
hw/display/virtio-gpu.c +1 -0
@@ -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 ; }
Signature · 1 line
1.8.3.1
Quoted 17 lines · Li Qiang
From: Li Qiang <[email protected]>
In
update_cursor_data_virglfunction, 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 <[email protected]>--- hw/display/virtio-gpu.c | 1 + 1 file changed, 1 insertion(+)hw/display/virtio-gpu.c +0
-0
hw/display/virtio-gpu.c static void update_cursor_data_virgl(VirtIOGPU *g, · line 90
Quoted 7 lines
hw/display/virtio-gpu.c +1
-0@@ -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 ; }
Added to vga patch queue.
thanks,
Gerd
Hi
Quoted 9 lines · Li Qiang
From: Li Qiang <[email protected]>
In
update_cursor_data_virglfunction, 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 <[email protected]>
---
Quoted 19 lines
hw/display/virtio-gpu.c | 1 + 1 file changed, 1 insertion(+)hw/display/virtio-gpu.c +1
-1@@ -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
Quoted 1 line
--
Marc-André Lureau