summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWu Guanghao <wuguanghao3@huawei.com>2023-03-04 00:21:32 +0800
committerJes Sorensen <jes@trained-monkey.org>2023-03-08 13:54:30 -0500
commitdac0b5121dd77bf1659b95248423445f932dfae4 (patch)
tree2b1e826a65282d906129b6302dc2e5aaa3123720
parent06ef619582b47af89eb094c164fc5effd46d6048 (diff)
downloadmdadm-dac0b5121dd77bf1659b95248423445f932dfae4.tar.gz
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 ce7a844..4ef2646 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;