]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super1.c
Don't close fds in write_init_super
[thirdparty/mdadm.git] / super1.c
index f879e669db79ee1bb3f0376d43bfc850141139fc..8a89d3b1cc00705bd6c3da78ce30121248653300 100644 (file)
--- a/super1.c
+++ b/super1.c
@@ -1641,6 +1641,13 @@ static void free_super1(struct supertype *st)
 {
        if (st->sb)
                free(st->sb);
+       while (st->info) {
+               struct devinfo *di = st->info;
+               st->info = di->next;
+               if (di->fd >= 0)
+                       close(di->fd);
+               free(di);
+       }
        st->sb = NULL;
 }