aboutsummaryrefslogtreecommitdiff
path: root/meta-linaro/recipes-extra/idlestat/files/0003-fix-memory-leak-in-cpuidle_get_target_residency-free.patch
blob: c9bb70dc16cfd6be5d5d74b755f9c261af52bd68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From 312b9908f8ab6ce208cadc7c47d5b2e9e47e1807 Mon Sep 17 00:00:00 2001
From: Colin Ian King <colin.king@canonical.com>
Date: Wed, 31 Aug 2016 09:54:01 +0100
Subject: [PATCH 3/5] fix memory leak in cpuidle_get_target_residency, free
 fpathA

fpath is not being free'd causing a small memory leak, free it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 idlestat.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/idlestat.c b/idlestat.c
index ede98a0..f6a07e5 100644
--- a/idlestat.c
+++ b/idlestat.c
@@ -293,6 +293,7 @@ int cpuidle_get_target_residency(int cpu, int state)
 		free(fpath);
 		return -1;
 	}
+	free(fpath);
 	ret = fscanf(snf, "%u", &tr);
 	fclose(snf);
 
-- 
2.9.3