aboutsummaryrefslogtreecommitdiff
path: root/idlestat.c
diff options
context:
space:
mode:
authorTuukka Tikkanen <tuukka.tikkanen@linaro.org>2014-12-03 13:17:40 +0200
committerTuukka Tikkanen <tuukka.tikkanen@linaro.org>2014-12-05 09:52:39 +0200
commitd9b36c634c38fca287d179eb6380163eb9a34373 (patch)
tree9fd22dae974e98e56967256d47e8f4165ed68682 /idlestat.c
parent27f2342b422a3284a07cc541d780192dfab483a1 (diff)
idlestat: Correct allocation size in inter()
The element count has already been incremented by the time of calling realloc in inter(), so adding +1 to the element count is unnecessary. Signed-off-by: Tuukka Tikkanen <tuukka.tikkanen@linaro.org>
Diffstat (limited to 'idlestat.c')
-rw-r--r--idlestat.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/idlestat.c b/idlestat.c
index 016d176..2102fa9 100644
--- a/idlestat.c
+++ b/idlestat.c
@@ -263,8 +263,7 @@ static struct cpuidle_cstate *inter(struct cpuidle_cstate *c1,
result->nrdata++;
- tmp = realloc(data, sizeof(*data) *
- (result->nrdata + 1));
+ tmp = realloc(data, sizeof(*data) * result->nrdata);
if (!tmp) {
free(data);
free(result);