Skip to content

Commit

Permalink
tools/hv: Fix file handle leak
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ben Hutchings authored and Greg Kroah-Hartman committed Sep 10, 2012
1 parent 16e8710 commit d5ab482
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/hv/hv_kvp_daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,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);
}

Expand Down Expand Up @@ -207,6 +207,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)
Expand Down

0 comments on commit d5ab482

Please sign in to comment.