* [PATCH] cpupower: fix memory leak in print_{on,off}line_cpus()
@ 2025-08-27 9:46 Cryolitia PukNgae via B4 Relay
0 siblings, 0 replies; only message in thread
From: Cryolitia PukNgae via B4 Relay @ 2025-08-27 9:46 UTC (permalink / raw)
To: Thomas Renninger, Shuah Khan, John B. Wyatt IV, John Kacur
Cc: linux-pm, linux-kernel, niecheng1, zhanjun, Cryolitia PukNgae
From: Cryolitia PukNgae <cryolitia@uniontech.com>
{on,off}online_cpus_str not free after use
Suggested-by: Jun Zhan <zhanjun@uniontech.com>
Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com>
---
tools/power/cpupower/utils/helpers/misc.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/power/cpupower/utils/helpers/misc.c b/tools/power/cpupower/utils/helpers/misc.c
index 166dc1e470ea6d70079fea6570750885d549603a..f3b4fe95520ff96a1be8b1ba8e7be1ec116b1bc0 100644
--- a/tools/power/cpupower/utils/helpers/misc.c
+++ b/tools/power/cpupower/utils/helpers/misc.c
@@ -213,6 +213,8 @@ void print_online_cpus(void)
bitmask_displaylist(online_cpus_str, str_len, online_cpus);
printf(_("Following CPUs are online:\n%s\n"), online_cpus_str);
}
+
+ free(online_cpus_str);
}
/* print_offline_cpus
@@ -232,6 +234,8 @@ void print_offline_cpus(void)
printf(_("Following CPUs are offline:\n%s\n"), offline_cpus_str);
printf(_("cpupower set operation was not performed on them\n"));
}
+
+ free(offline_cpus_str);
}
/*
---
base-commit: fab1beda7597fac1cecc01707d55eadb6bbe773c
change-id: 20250827-power-memoryleak-75c692220277
Best regards,
--
Cryolitia PukNgae <cryolitia@uniontech.com>
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-08-27 9:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-27 9:46 [PATCH] cpupower: fix memory leak in print_{on,off}line_cpus() Cryolitia PukNgae via B4 Relay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).