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>
This commit is contained in:
Gerd Hoffmann 2015-12-18 11:55:01 +01:00
parent bba19b88a6
commit 8d94c1ca53
1 changed files with 2 additions and 1 deletions

View File

@ -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);
}