From: Wu Guanghao Date: Tue, 14 Oct 2025 03:29:37 +0000 (+0800) Subject: mdadm: Fix memory leak issue in Manage_stop() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b67f6f01c8c1638bca5c2c9327720b2b8197768f;p=thirdparty%2Fmdadm.git 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 --- diff --git a/Manage.c b/Manage.c index 22b1f52b..b53e65e9 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