Skip to content
Commit 5e5fd36c authored by Colin Ian King's avatar Colin Ian King Committed by Len Brown
Browse files

tools/power turbostat: Fix file pointer leak



Currently if a fscanf fails then an early return leaks an open
file pointer. Fix this by fclosing the file before the return.
Detected using static analysis with cppcheck:

tools/power/x86/turbostat/turbostat.c:2039:3: error: Resource leak: fp [resourceLeak]

Fixes: eae97e05 ("tools/power turbostat: Support thermal throttle count print")
Signed-off-by: default avatarColin Ian King <colin.i.king@gmail.com>
Acked-by: default avatarChen Yu <yu.c.chen@intel.com>
Reviewed-by: default avatarTom Rix <trix@redhat.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent e13da9a1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment