virtio-gpu: fix memory leak in update_cursor_data_virgl
commit2d1cd6c7a91a4beb99a0c3a21be529222a708545
authorLi Qiang <liqiang6-s@360.cn>
Tue, 1 Nov 2016 11:06:58 +0000 (1 04:06 -0700)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 5 Dec 2016 08:37:52 +0000 (5 09:37 +0100)
tree7a5f90e17d4466471002a25fa97ae430f4f0edb8
parent42a8dadc74f8982fc269e54e3c5627b54d9f83d8
virtio-gpu: fix memory leak in update_cursor_data_virgl

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>
Message-id: 58187760.41d71c0a.cca75.4cb9@mx.google.com
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/display/virtio-gpu.c