[PATCH v1] cpuuse: Fix top command memory leak

tianye at sugon.com tianye at sugon.com
Wed Dec 27 05:42:15 UTC 2023


From: Tian Ye <tianye at sugon.com>

---
 cpukit/libmisc/cpuuse/cpuusagetop.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/cpukit/libmisc/cpuuse/cpuusagetop.c b/cpukit/libmisc/cpuuse/cpuusagetop.c
index eed89ad211..2b0467dd6f 100644
--- a/cpukit/libmisc/cpuuse/cpuusagetop.c
+++ b/cpukit/libmisc/cpuuse/cpuusagetop.c
@@ -529,6 +529,7 @@ rtems_cpuusage_top_thread (rtems_task_argument arg)
   }
 
   free(data->tasks);
+  free(data->usage);
   free(data->last_tasks);
   free(data->last_usage);
   free(data->current_usage);
-- 
2.34.1



More information about the devel mailing list