Skip to content
Snippets Groups Projects
Commit 25b2ef2e authored by Gerd Hoffmann's avatar Gerd Hoffmann
Browse files

vhost-user-gpu: reorder free calls.


Free in correct order to avoid use-after-free.

Resolves: CID 1453812
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: default avatarLi Qiang <liq3ea@gmail.com>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210604103714.1237414-1-kraxel@redhat.com>
parent 05ece98f
No related branches found
No related tags found
No related merge requests found
......@@ -350,8 +350,8 @@ vg_resource_create_2d(VuGpu *g,
if (!res->image) {
g_critical("%s: resource creation failed %d %d %d",
__func__, c2d.resource_id, c2d.width, c2d.height);
g_free(res);
vugbm_buffer_destroy(&res->buffer);
g_free(res);
cmd->error = VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY;
return;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment