virtio-gpu: Fix memory leak in virtio_gpu_load()
commitc84f0f25db2eaab101665ddb60c1ddf1decce76a
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 9 Jan 2017 13:38:43 +0000 (9 13:38 +0000)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 11 Jan 2017 08:19:05 +0000 (11 09:19 +0100)
treeee75e73c50f4038ed59f8ac7b7d8a6794b5e4fd7
parent039aa5db0e7d9edb2bd807c2d4e09d8d7be4c9c4
virtio-gpu: Fix memory leak in virtio_gpu_load()

Coverity points out that if we fail in the "creating resources"
loop in virtio_gpu_load() we will leak various resources (CID 1356431).
Failing a VM load is going to leave the simulation in a complete mess,
but we can tidy up to the point that a full system reset should
get us back to sanity.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1483969123-14839-3-git-send-email-peter.maydell@linaro.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/display/virtio-gpu.c