mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
radv: fix memory leaks in radv_load_meta_pipeline()
Reported by Coverity.
Fixes: fbcd167314 ("radv: Add on-demand compilation of built-in shaders.")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
parent
17e79865cf
commit
85113c4d05
1 changed files with 3 additions and 2 deletions
|
|
@ -263,6 +263,7 @@ radv_load_meta_pipeline(struct radv_device *device)
|
|||
char path[PATH_MAX + 1];
|
||||
struct stat st;
|
||||
void *data = NULL;
|
||||
bool ret = false;
|
||||
|
||||
if (!radv_builtin_cache_path(path))
|
||||
return false;
|
||||
|
|
@ -278,11 +279,11 @@ radv_load_meta_pipeline(struct radv_device *device)
|
|||
if(read(fd, data, st.st_size) == -1)
|
||||
goto fail;
|
||||
|
||||
return radv_pipeline_cache_load(&device->meta_state.cache, data, st.st_size);
|
||||
ret = radv_pipeline_cache_load(&device->meta_state.cache, data, st.st_size);
|
||||
fail:
|
||||
free(data);
|
||||
close(fd);
|
||||
return false;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue