close some memory leaks

From: Dan Williams <dan.j.williams@intel.com>

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
Dan Williams 2008-05-15 16:48:56 +10:00 committed by Neil Brown
parent 3e70c845e2
commit 4fa5aef966
2 changed files with 4 additions and 0 deletions

View File

@ -259,6 +259,7 @@ static void manage_new(struct mdstat_ent *mdstat,
new->sync_pos_fd = sysfs_open(new->devnum, NULL, "sync_completed");
new->sync_pos = 0;
sysfs_free(mdi);
// finds and compares.
if (container->ss->open_new(container, new, inst) < 0) {
// FIXME close all those files
@ -377,6 +378,8 @@ void do_manager(struct supertype *container)
read_sock(container);
free_mdstat(mdstat);
mdstat_wait_fd(container->sock);
} while(1);
}

View File

@ -95,6 +95,7 @@ void free_mdstat(struct mdstat_ent *ms)
if (ms->dev) free(ms->dev);
if (ms->level) free(ms->level);
if (ms->pattern) free(ms->pattern);
if (ms->metadata_version) free(ms->metadata_version);
t = ms;
ms = ms->next;
free(t);