Free mdstat data structures properly.

In one case we called 'free' instead of 'mdstat_free'.
In others we didn't free at all.

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2009-01-08 09:25:31 +11:00
parent 3a56f223e9
commit 89a10d84cb
3 changed files with 4 additions and 1 deletions

View File

@ -619,7 +619,7 @@ int Wait(char *dev)
free_mdstat(ms);
return rv;
}
free(ms);
free_mdstat(ms);
rv = 0;
mdstat_wait(5);
}

View File

@ -245,6 +245,7 @@ void RebuildMap(void)
break;
}
}
free_mdstat(mdstat);
map_write(map);
map_free(map);
}

View File

@ -1217,6 +1217,7 @@ int main(int argc, char *argv[])
export, test, homehost);
put_md_name(name);
}
free_mdstat(ms);
} else if (devmode == 'S' && scan) {
/* apply --stop to all devices in /proc/mdstat */
/* Due to possible stacking of devices, repeat until
@ -1249,6 +1250,7 @@ int main(int argc, char *argv[])
put_md_name(name);
}
free_mdstat(ms);
} while (!last && err);
if (err) rv |= 1;
} else {