summaryrefslogtreecommitdiffstats
path: root/dlink.h
diff options
context:
space:
mode:
authorAnna Sztukowska <anna.sztukowska@intel.com>2024-08-08 17:02:38 +0200
committerMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>2024-09-10 10:56:56 +0200
commitda26064bfe4457d5037f3a1f1bb83a54225c6375 (patch)
treeb567aa633d12c177a756145dbd850deb01353e22 /dlink.h
parentimsm: save checkpoint prior to exit (diff)
downloadmdadm-da26064bfe4457d5037f3a1f1bb83a54225c6375.tar.xz
mdadm-da26064bfe4457d5037f3a1f1bb83a54225c6375.zip
Examine.c: Fix memory leaks in Examine()
Fix memory leaks in Examine() reported by SAST analysis. Implement a method to traverse and free all the nodes of the doubly linked list. Replace for loop with while loop in order to improve redability of the code and free allocated memory correctly. Signed-off-by: Anna Sztukowska <anna.sztukowska@intel.com>
Diffstat (limited to 'dlink.h')
-rw-r--r--dlink.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/dlink.h b/dlink.h
index ab2a9459..ce667839 100644
--- a/dlink.h
+++ b/dlink.h
@@ -23,3 +23,4 @@ void dl_add(void*, void*);
void dl_del(void*);
void dl_free(void*);
void dl_init(void*);
+void dl_free_all(void *head);