CCache: Fix memory/file descriptor leaks
Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
This commit is contained in:
parent
9b371b48d1
commit
478d5df911
5 changed files with 25 additions and 4 deletions
|
|
@ -138,7 +138,10 @@ static void stats_update_size(enum stats stat, size_t size, size_t numfiles)
|
|||
|
||||
memset(counters, 0, sizeof(counters));
|
||||
|
||||
if (lock_fd(fd) != 0) return;
|
||||
if (lock_fd(fd) != 0) {
|
||||
close(fd);
|
||||
return;
|
||||
}
|
||||
|
||||
/* read in the old stats */
|
||||
stats_read_fd(fd, counters);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue