aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2014-02-18 08:51:30 +0100
committerDaniel Lezcano <daniel.lezcano@free.fr>2014-02-18 08:51:30 +0100
commite4f2085c3abf3fa5db3318bf82348736d6c43714 (patch)
treea2c5e379cece8674425447a5bc81fbb93a722eda
parent69dde53657504f92e1f13c321a791917e79249cf (diff)
Fix memory leak, result is being leaked on a realloc failure
A realloc failure leaks result on the error return path. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
-rw-r--r--idlestat.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/idlestat.c b/idlestat.c
index 41ed3ab..739f6dc 100644
--- a/idlestat.c
+++ b/idlestat.c
@@ -221,6 +221,7 @@ static struct cpuidle_cstate *inter(struct cpuidle_cstate *c1,
(result->nrdata + 1));
if (!tmp) {
free(data);
+ free(result);
return NULL;
}
data = tmp;