summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWu Guanghao <wuguanghao3@huawei.com>2023-03-03 17:21:32 +0100
committerJes Sorensen <jes@trained-monkey.org>2023-03-08 19:54:30 +0100
commitdac0b5121dd77bf1659b95248423445f932dfae4 (patch)
tree2b1e826a65282d906129b6302dc2e5aaa3123720
parentutil.c: fix memleak in parse_layout_faulty() (diff)
downloadmdadm-dac0b5121dd77bf1659b95248423445f932dfae4.tar.xz
mdadm-dac0b5121dd77bf1659b95248423445f932dfae4.zip
Detail.c: fix memleak in Detail()
char *sysdev = xstrdup() but not free() in for loop, will cause memory leak Signed-off-by: Wu Guanghao <wuguanghao3@huawei.com> Acked-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> Acked-by: Coly Li <colyli@suse.de> Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
-rw-r--r--Detail.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Detail.c b/Detail.c
index ce7a8445..4ef26460 100644
--- a/Detail.c
+++ b/Detail.c
@@ -303,6 +303,7 @@ int Detail(char *dev, struct context *c)
if (path)
printf("MD_DEVICE_%s_DEV=%s\n",
sysdev, path);
+ free(sysdev);
}
}
goto out;