diff --git a/Examine.c b/Examine.c index f0e98f9..3d0ea8a 100644 --- a/Examine.c +++ b/Examine.c @@ -114,10 +114,8 @@ int Examine(mddev_dev_t devlist, int brief, int export, int scan, ap->st = st; arrays = ap; st->ss->getinfo_super(st, &ap->info); - } else { + } else st->ss->getinfo_super(st, &ap->info); - st->ss->free_super(st); - } if (!(ap->info.disk.state & (1<spares++; d = dl_strdup(devlist->devname); diff --git a/super-ddf.c b/super-ddf.c index 517a586..8153924 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -762,6 +762,9 @@ static int load_ddf_local(int fd, struct ddf_super *super, static int load_super_ddf_all(struct supertype *st, int fd, void **sbp, char *devname, int keep_fd); #endif + +static void free_super_ddf(struct supertype *st); + static int load_super_ddf(struct supertype *st, int fd, char *devname) { @@ -798,6 +801,8 @@ static int load_super_ddf(struct supertype *st, int fd, return 1; } + free_super_ddf(st); + if (posix_memalign((void**)&super, 512, sizeof(*super))!= 0) { fprintf(stderr, Name ": malloc of %zu failed.\n", sizeof(*super)); diff --git a/super-intel.c b/super-intel.c index 24827d0..7b04a79 100644 --- a/super-intel.c +++ b/super-intel.c @@ -2196,6 +2196,8 @@ static int load_super_imsm(struct supertype *st, int fd, char *devname) return 0; #endif + free_super_imsm(st); + super = alloc_super(0); if (!super) { fprintf(stderr,