mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 05:08:08 +02:00
d3d12: Fix memory leak if create_gfx_pipeline_state failed.
Fix defect reported by Coverity Scan.
Resource leak (RESOURCE_LEAK)
leaked_storage: Variable data going out of scope leaks the storage it points to.
Fixes: 2ea15cd661 ("d3d12: introduce d3d12 gallium driver")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8150>
This commit is contained in:
parent
f9ceab7b23
commit
1ff5463ff8
1 changed files with 3 additions and 1 deletions
|
|
@ -312,8 +312,10 @@ d3d12_get_gfx_pipeline_state(struct d3d12_context *ctx)
|
|||
|
||||
data->key = ctx->gfx_pipeline_state;
|
||||
data->pso = create_gfx_pipeline_state(ctx);
|
||||
if (!data->pso)
|
||||
if (!data->pso) {
|
||||
FREE(data);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
entry = _mesa_hash_table_insert_pre_hashed(ctx->pso_cache, hash, &data->key, data);
|
||||
assert(entry);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue