diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2012-09-05 17:37:35 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-10 19:43:05 -0400 |
commit | d5ab482799e7c4c4b7c0aa67e8710dce28115d03 (patch) | |
tree | affcbb7e65183de0a42f700666c4328ac5f3fd86 /tools | |
parent | 16e87100e62330cb1e58ee772cacb7d4e6d5b61b (diff) |
tools/hv: Fix file handle leak
Match up each fopen() with an fclose().
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/hv/hv_kvp_daemon.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c index c8e101363735..4514fb41da5e 100644 --- a/tools/hv/hv_kvp_daemon.c +++ b/tools/hv/hv_kvp_daemon.c | |||
@@ -160,7 +160,7 @@ static void kvp_update_file(int pool) | |||
160 | sizeof(struct kvp_record), | 160 | sizeof(struct kvp_record), |
161 | kvp_file_info[pool].num_records, filep); | 161 | kvp_file_info[pool].num_records, filep); |
162 | 162 | ||
163 | fflush(filep); | 163 | fclose(filep); |
164 | kvp_release_lock(pool); | 164 | kvp_release_lock(pool); |
165 | } | 165 | } |
166 | 166 | ||
@@ -207,6 +207,7 @@ static void kvp_update_mem_state(int pool) | |||
207 | kvp_file_info[pool].records = record; | 207 | kvp_file_info[pool].records = record; |
208 | kvp_file_info[pool].num_records = records_read; | 208 | kvp_file_info[pool].num_records = records_read; |
209 | 209 | ||
210 | fclose(filep); | ||
210 | kvp_release_lock(pool); | 211 | kvp_release_lock(pool); |
211 | } | 212 | } |
212 | static int kvp_file_init(void) | 213 | static int kvp_file_init(void) |