mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-20 20:50:44 +02:00
util/disk_cache: Don't leak when cache is empty
When we exit early having failed to find any candidate cache files to
evict, don't leak the list head whilst doing so.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Fixes: f58e6fee74 ("util/disk_cache: delete more cache items in one go when full")
Ref: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11523>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11682>
This commit is contained in:
parent
19cf64aabd
commit
d40f8a2fcb
1 changed files with 1 additions and 0 deletions
|
|
@ -242,6 +242,7 @@ choose_lru_file_matching(const char *dir_path,
|
|||
|
||||
if (list_is_empty(lru_file_list)) {
|
||||
closedir(dir);
|
||||
free(lru_file_list);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue