]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - config.c
Free map to avoid resource leak issues
[thirdparty/mdadm.git] / config.c
index 48e0278880cf937a55f684092165af738642a784..e14eae0cdab31b62b034063fd32ead125bdccc41 100644 (file)
--- a/config.c
+++ b/config.c
@@ -181,9 +181,10 @@ struct mddev_dev *load_containers(void)
                        }
                        d->next = rv;
                        rv = d;
+                       map_free(map);
+                       map = NULL;
                }
        free_mdstat(mdstat);
-       map_free(map);
 
        return rv;
 }