From b67f6f01c8c1638bca5c2c9327720b2b8197768f Mon Sep 17 00:00:00 2001 From: Wu Guanghao Date: Tue, 14 Oct 2025 11:29:37 +0800 Subject: [PATCH 68/74] mdadm: Fix memory leak issue in Manage_stop() The local variable 'mds' allocated in Manage_stop() is only released under specific conditions in the for loop. This can lead to memory leak when under othe conditions. Signed-off-by: Wu Guanghao --- Manage.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Manage.c b/Manage.c index 22b1f52b7dc7..b53e65e9cea2 100644 --- a/Manage.c +++ b/Manage.c @@ -286,6 +286,7 @@ int Manage_stop(char *devname, int fd, int verbose, int will_retry) rv = 1; goto out; } + free_mdstat(mds); } /* If the array is undergoing a reshape which changes the number -- 2.50.1