diff options
author | Anna Sztukowska <anna.sztukowska@intel.com> | 2024-08-08 17:02:38 +0200 |
---|---|---|
committer | Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> | 2024-09-10 10:56:56 +0200 |
commit | da26064bfe4457d5037f3a1f1bb83a54225c6375 (patch) | |
tree | b567aa633d12c177a756145dbd850deb01353e22 /dlink.h | |
parent | imsm: save checkpoint prior to exit (diff) | |
download | mdadm-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.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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); |