diff options
author | Guanqin Miao <miaoguanqin@huawei.com> | 2023-04-24 10:06:37 +0200 |
---|---|---|
committer | Jes Sorensen <jes@trained-monkey.org> | 2023-09-01 18:08:06 +0200 |
commit | e62a561ee8b7157a2390eab215dcef6240bd7b03 (patch) | |
tree | 256b7207c81a4181cd3721084a86783585d644a1 | |
parent | Fix memory leak in file Manage (diff) | |
download | mdadm-e62a561ee8b7157a2390eab215dcef6240bd7b03.tar.xz mdadm-e62a561ee8b7157a2390eab215dcef6240bd7b03.zip |
Fix memory leak in file mdadm
When we test mdadm with asan, we found some memory leaks in mdadm.c
We fix these memory leaks based on code logic.
Signed-off-by: Guanqin Miao <miaoguanqin@huawei.com>
Signed-off-by: Li Xiao Keng <lixiaokeng@huawei.com>
Acked-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
-rw-r--r-- | mdadm.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -1708,6 +1708,10 @@ int main(int argc, char *argv[]) autodetect(); break; } + if (ss) { + ss->ss->free_super(ss); + free(ss); + } if (locked) cluster_release_dlmlock(); close_fd(&mdfd); |