[PATCH] lib: fwts_battery: fix no fclose() after fopen is called.
Keng-Yu Lin
kengyu at canonical.com
Wed May 23 06:11:59 UTC 2012
On Tue, May 22, 2012 at 5:03 PM, Alex Hung <alex.hung at canonical.com> wrote:
> Signed-off-by: Alex Hung <alex.hung at canonical.com>
> ---
> src/lib/src/fwts_battery.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/src/lib/src/fwts_battery.c b/src/lib/src/fwts_battery.c
> index d8cc318..5f21dfa 100644
> --- a/src/lib/src/fwts_battery.c
> +++ b/src/lib/src/fwts_battery.c
> @@ -101,6 +101,7 @@ static int fwts_battery_get_capacity_sys_fs(fwts_framework *fw,
> (*count)++;
> }
> }
> + fclose(fp);
> }
> }
> } while (entry);
> @@ -167,6 +168,7 @@ static int fwts_battery_get_capacity_proc_fs(fwts_framework *fw,
> break;
> }
> }
> + fclose(fp);
> }
> }
> } while (entry);
> @@ -307,6 +309,7 @@ static int fwts_battery_get_cycle_count_sys_fs(fwts_framework *fw, DIR *dir, int
> *cycle_count = val;
> }
> }
> + fclose(fp);
> }
> }
> } while (entry);
> @@ -350,6 +353,7 @@ static int fwts_battery_get_cycle_count_proc_fs(fwts_framework *fw, DIR *dir, in
> break;
> }
> }
> + fclose(fp);
> }
> }
> } while (entry);
> --
> 1.7.9.5
>
Acked-by: Keng-Yu Lin <kengyu at canonical.com>
More information about the fwts-devel
mailing list