From: Colin Ian King <[email protected]>

A realloc failure leaks result on the error return path.

Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Daniel Lezcano <[email protected]>
---
 idlestat.c |    1 +
 1 file changed, 1 insertion(+)

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;
-- 
1.7.9.5


_______________________________________________
linaro-dev mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/linaro-dev

Reply via email to