mdadm/0068-mdadm-Fix-memory-leak-issue-in-Manage_stop.patch
Xiao Ni aa7b8fe976 Update to latest upstream
Resolves: RHEL-100004, RHEL-107084

Signed-off-by: Xiao Ni <xni@redhat.com>
2025-10-28 17:17:30 +08:00

30 lines
828 B
Diff

From b67f6f01c8c1638bca5c2c9327720b2b8197768f Mon Sep 17 00:00:00 2001
From: Wu Guanghao <wuguanghao3@huawei.com>
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 <wuguanghao3@huawei.com>
---
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