]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Assemble: fix redundant memory free
authorKinga Tanska <kinga.tanska@intel.com>
Tue, 12 Sep 2023 02:27:01 +0000 (04:27 +0200)
committerJes Sorensen <jes@trained-monkey.org>
Thu, 26 Oct 2023 21:19:17 +0000 (17:19 -0400)
Commit e9fb93af0f76 ("Fix memory leak in file Assemble")
fixes few memory leaks in Assemble, but it introduces
problem with assembling RAID volume. It was caused by
clearing metadata too fast, not only on fail in
select_devices() function.
This commit removes redundant memory free.

Signed-off-by: Kinga Tanska <kinga.tanska@intel.com>
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
Assemble.c

index 61e8cd17e33265ade0de725b2f28b5c3015682cf..5be58e4066c57663156a68cbb5f19bcc015305ad 100644 (file)
@@ -428,8 +428,6 @@ static int select_devices(struct mddev_dev *devlist,
 
                        /* make sure we finished the loop */
                        tmpdev = NULL;
-                       free(st);
-                       st = NULL;
                        goto loop;
                } else {
                        content = *contentp;