aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2015-12-18 11:55:01 +0100
committerGerd Hoffmann <kraxel@redhat.com>2016-02-03 10:41:36 +0100
commit8d94c1ca53c638f6ec76840b0cb24677fb7705bf (patch)
tree575cdfb8fab33fe3b6f6d9833913e59ebd63b7c4 /hw
parentbba19b88a6bce3adc280b0d7b6a4fc51445afd80 (diff)
virtio-gpu: fix memory leak in error path
Found by Coverity Scan, buf not freed on error. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/display/virtio-gpu-3d.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/display/virtio-gpu-3d.c b/hw/display/virtio-gpu-3d.c
index 59581a4cd2..e13122dd1e 100644
--- a/hw/display/virtio-gpu-3d.c
+++ b/hw/display/virtio-gpu-3d.c
@@ -198,7 +198,7 @@ static void virgl_cmd_submit_3d(VirtIOGPU *g,
qemu_log_mask(LOG_GUEST_ERROR, "%s: size mismatch (%zd/%d)",
__func__, s, cs.size);
cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER;
- return;
+ goto out;
}
if (virtio_gpu_stats_enabled(g->conf)) {
@@ -208,6 +208,7 @@ static void virgl_cmd_submit_3d(VirtIOGPU *g,
virgl_renderer_submit_cmd(buf, cs.hdr.ctx_id, cs.size / 4);
+out:
g_free(buf);
}