mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 15:10:10 +01:00
vulkan/runtime: fix memleak when creating ETC pipelines
NIR must be freed.
Found with ASAN.
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37844>
(cherry picked from commit ddef2c1559)
This commit is contained in:
parent
131f2c2aea
commit
649cd492e5
2 changed files with 7 additions and 3 deletions
|
|
@ -1404,7 +1404,7 @@
|
|||
"description": "vulkan/runtime: fix memleak when creating ETC pipelines",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -437,6 +437,7 @@ etc2_init_pipeline(struct vk_device *device, struct vk_texcompress_etc2_state *e
|
|||
{
|
||||
const struct vk_device_dispatch_table *disp = &device->dispatch_table;
|
||||
VkDevice _device = vk_device_to_handle(device);
|
||||
VkResult result;
|
||||
|
||||
nir_shader *cs = etc2_build_shader(device, etc2->nir_options);
|
||||
|
||||
|
|
@ -452,8 +453,11 @@ etc2_init_pipeline(struct vk_device *device, struct vk_texcompress_etc2_state *e
|
|||
.layout = etc2->pipeline_layout,
|
||||
};
|
||||
|
||||
return disp->CreateComputePipelines(_device, etc2->pipeline_cache, 1, &pipeline_create_info, etc2->allocator,
|
||||
&etc2->pipeline);
|
||||
result = disp->CreateComputePipelines(_device, etc2->pipeline_cache, 1, &pipeline_create_info, etc2->allocator,
|
||||
&etc2->pipeline);
|
||||
|
||||
ralloc_free(cs);
|
||||
return result;
|
||||
}
|
||||
|
||||
static VkResult
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue