summaryrefslogtreecommitdiff
path: root/CCache/stats.c
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2016-06-26 00:07:10 +0100
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2016-06-26 00:16:30 +0100
commit2da7e066b331d2aff98ef8f20d151bfef67497c7 (patch)
treef2e067b6db66c3d4f59750d3739a3325d3222ddc /CCache/stats.c
parent875aca59760bbccb8343723b2263a85fa8e5d455 (diff)
parentadfa531a3b602d953e4127bc0968c30e5afa584d (diff)
downloadswig-2da7e066b331d2aff98ef8f20d151bfef67497c7.tar.gz
Merge branch 'avalluri-leaks'
* avalluri-leaks: whitespace fix memory leak improvements - delete at end of scope CCache: Fix typo in null check CCache: Fix memory/file descriptor leaks scilab.cxx: Fix memory leaks Fix leaked file descriptor Lua: Fix possible memory leaks go.cxx: Fix use of a freed variable Closes #710 Closes #712 Closes #713 Closes #715 Closes #716
Diffstat (limited to 'CCache/stats.c')
-rw-r--r--CCache/stats.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/CCache/stats.c b/CCache/stats.c
index d2122bcd3..4d01d2afa 100644
--- a/CCache/stats.c
+++ b/CCache/stats.c
@@ -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);