diff options
author | Tuukka Tikkanen <tuukka.tikkanen@linaro.org> | 2014-11-17 19:09:02 +0200 |
---|---|---|
committer | Tuukka Tikkanen <tuukka.tikkanen@linaro.org> | 2014-11-17 19:09:02 +0200 |
commit | 4def3df8b357b8f4c2f70859f9b381338ec953b6 (patch) | |
tree | 4b574d683a33fb3b5be7cc51f2b2d72e8ee34bc2 | |
parent | 55b957a2c275f588c0e7f1e1851e7ea2e1cd0388 (diff) |
load_and_build_cstate_info: Plug a memory leak in error path
This patch plugs a leak that occurs when cstate data is not
what we expect.
Signed-off-by: Tuukka Tikkanen <tuukka.tikkanen@linaro.org>
-rw-r--r-- | idlestat.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -702,8 +702,10 @@ static struct cpuidle_cstates *load_and_build_cstate_info(FILE* f, int nrcpus) sscanf(buffer, "cpuid %d:\n", &read_cpu); - if (read_cpu != cpu) + if (read_cpu != cpu) { + release_cstate_info(cstates, cpu); return NULL; + } for (i = 0; i < MAXCSTATE; i++) { char *name = malloc(128); |