mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 16:08:04 +02:00
radv: Fix memory leak on error path.
Fix defect reported by Coverity Scan.
Resource leak (RESOURCE_LEAK)
leaked_storage: Variable prolog going out of scope leaks the storage it points to
Fixes: 80841196b2 ("radv: implement dynamic vertex input state using vertex shader prologs")
Suggested-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13402>
This commit is contained in:
parent
b797ecac7a
commit
670fd8123b
1 changed files with 1 additions and 0 deletions
|
|
@ -2839,6 +2839,7 @@ lookup_vs_prolog(struct radv_cmd_buffer *cmd_buffer, struct radv_shader_variant
|
|||
prolog = radv_create_vs_prolog(device, &key);
|
||||
uint32_t *key2 = malloc(key_size * 4);
|
||||
if (!prolog || !key2) {
|
||||
radv_prolog_destroy(device, prolog);
|
||||
free(key2);
|
||||
u_rwlock_wrunlock(&device->vs_prologs_lock);
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue