[PATCH] bootchartd-handle-leak in bootchartd.c:224

Сергей Губарёв sergeygubarev263 at gmail.com
Sat Mar 1 11:54:42 UTC 2025


From: Sergey Gubarev <sergeygubarev263 at gmail.com>

Good day, dear maintainer.

There may be a memory leak in BusyBox 1.36.0 due to an explicitly unclosed
proc_ps descriptor. I propose a possible solution to the issue.


---
 busybox/init/bootchartd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/busybox/init/bootchartd.c b/busybox/init/bootchartd.c
index ae1ee9d..eb1b62b 100644
--- a/busybox/init/bootchartd.c
+++ b/busybox/init/bootchartd.c
@@ -260,6 +260,7 @@ static void do_logging(unsigned sample_period_us, int
process_accounting)
  wait_more:
                usleep(sample_period_us);
        }
+       fclose(proc_ps);
 }

 static void finalize(char *tempdir, const char *prog, int
process_accounting)
--
2.30.2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20250301/868ac505/attachment-0001.htm>


More information about the busybox mailing list