mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-04 02:00:35 +01:00
util/disk_cache: close a previously opened handle in disk_cache_put (v2)
We're missing the close() to the matching open().
CID 1373407
v2: Fixes from Emil Velikov's review
Update the teardown in reverse order of the setup/init.
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Mun Gwan-gyeong <elongbug@gmail.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> (v1)
(cherry picked from commit 69cc7d90f9)
This commit is contained in:
parent
d6964bbf54
commit
c19a331139
1 changed files with 5 additions and 6 deletions
|
|
@ -612,19 +612,18 @@ cache_put(struct program_cache *cache,
|
|||
|
||||
p_atomic_add(cache->size, size);
|
||||
|
||||
done:
|
||||
if (fd_final != -1)
|
||||
close(fd_final);
|
||||
/* This close finally releases the flock, (now that the final dile
|
||||
* has been renamed into place and the size has been added).
|
||||
*/
|
||||
close(fd);
|
||||
fd = -1;
|
||||
|
||||
done:
|
||||
if (fd != -1)
|
||||
close(fd);
|
||||
if (filename_tmp)
|
||||
ralloc_free(filename_tmp);
|
||||
if (filename)
|
||||
ralloc_free(filename);
|
||||
if (fd != -1)
|
||||
close(fd);
|
||||
}
|
||||
|
||||
void *
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue