mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
virgl: Allocate qdws after virgl_init_context to avoid leak.
Fix defect reported by Coverity Scan.
Resource leak (RESOURCE_LEAK)
leaked_storage: Variable qdws going out of scope leaks the storage it
points to.
Fixes: 9a7d6a110e ("virgl/drm: explicit context initialization")
Suggested-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13609>
This commit is contained in:
parent
1ca90f8752
commit
4a38ed822a
1 changed files with 4 additions and 4 deletions
|
|
@ -1220,16 +1220,16 @@ virgl_drm_winsys_create(int drmFD)
|
|||
if (drm_version < 0)
|
||||
return NULL;
|
||||
|
||||
qdws = CALLOC_STRUCT(virgl_drm_winsys);
|
||||
if (!qdws)
|
||||
return NULL;
|
||||
|
||||
if (params[param_context_init].value) {
|
||||
ret = virgl_init_context(drmFD);
|
||||
if (ret)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
qdws = CALLOC_STRUCT(virgl_drm_winsys);
|
||||
if (!qdws)
|
||||
return NULL;
|
||||
|
||||
qdws->fd = drmFD;
|
||||
virgl_resource_cache_init(&qdws->cache, CACHE_TIMEOUT_USEC,
|
||||
virgl_drm_resource_cache_entry_is_busy,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue