From: Dan Williams Date: Thu, 15 May 2008 06:48:56 +0000 (+1000) Subject: close some memory leaks X-Git-Tag: devel~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4fa5aef9667535147d3069360a1f1b543fe2b1ea;p=thirdparty%2Fmdadm.git close some memory leaks From: Dan Williams Signed-off-by: Dan Williams --- diff --git a/managemon.c b/managemon.c index 23019468..c5ba2f4c 100644 --- a/managemon.c +++ b/managemon.c @@ -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); } diff --git a/mdstat.c b/mdstat.c index c75260e8..a65e7c3a 100644 --- a/mdstat.c +++ b/mdstat.c @@ -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);