summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2012-09-06 01:37:35 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-07 19:32:25 +0400
commit37b6d804b3b5e2a255d2182ce00e1f25c568d7e9 (patch)
tree6040d52800a23618a978915d5d71624c482f4620 /tools
parent268b7d491c88845b410b2dfc84af54075db35c4d (diff)
downloadlinux-37b6d804b3b5e2a255d2182ce00e1f25c568d7e9.tar.xz
tools/hv: Fix file handle leak
commit d5ab482799e7c4c4b7c0aa67e8710dce28115d03 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/hv/hv_kvp_daemon.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c
index d9834b362943..a08213b2250b 100644
--- a/tools/hv/hv_kvp_daemon.c
+++ b/tools/hv/hv_kvp_daemon.c
@@ -144,7 +144,7 @@ static void kvp_update_file(int pool)
sizeof(struct kvp_record),
kvp_file_info[pool].num_records, filep);
- fflush(filep);
+ fclose(filep);
kvp_release_lock(pool);
}
@@ -191,6 +191,7 @@ static void kvp_update_mem_state(int pool)
kvp_file_info[pool].records = record;
kvp_file_info[pool].num_records = records_read;
+ fclose(filep);
kvp_release_lock(pool);
}
static int kvp_file_init(void)