summaryrefslogtreecommitdiffstats
path: root/Examine.c
diff options
context:
space:
mode:
Diffstat (limited to 'Examine.c')
-rw-r--r--Examine.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/Examine.c b/Examine.c
index c9605a60..fe162167 100644
--- a/Examine.c
+++ b/Examine.c
@@ -111,8 +111,10 @@ int Examine(struct mddev_dev *devlist,
close(fd);
if (err) {
- if (st)
+ if (st) {
st->ss->free_super(st);
+ free(st);
+ }
continue;
}
@@ -152,19 +154,24 @@ int Examine(struct mddev_dev *devlist,
if (st->ss->export_examine_super)
st->ss->export_examine_super(st);
st->ss->free_super(st);
+ free(st);
} else {
printf("%s:\n",devlist->devname);
st->ss->examine_super(st, c->homehost);
st->ss->free_super(st);
+ free(st);
}
}
if (c->brief) {
- struct array *ap;
- for (ap = arrays; ap; ap = ap->next) {
+ struct array *ap = arrays, *next;
+
+ while (ap) {
char sep='=';
char *d;
int newline = 0;
+ next = ap->next;
+
ap->st->ss->brief_examine_super(ap->st, c->verbose > 0);
if (ap->spares && !ap->st->ss->external)
newline += printf(" spares=%d", ap->spares);
@@ -182,10 +189,15 @@ int Examine(struct mddev_dev *devlist,
printf("\n");
ap->st->ss->brief_examine_subarrays(ap->st, c->verbose);
}
- ap->st->ss->free_super(ap->st);
- /* FIXME free ap */
if (ap->spares || c->verbose > 0)
printf("\n");
+
+ ap->st->ss->free_super(ap->st);
+ free(ap->st);
+ dl_free_all(ap->devs);
+ free(ap);
+
+ ap = next;
}
}
return rv;