diff options
author | Jes Sorensen <Jes.Sorensen@redhat.com> | 2011-11-01 16:09:32 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-11-02 10:48:53 +1100 |
commit | b657208c50a8924a3b9ae2d7b2dc9bfbf37220ee (patch) | |
tree | 2b05e10c5a126ab68bdaf99595845803378eb4db /Monitor.c | |
parent | bccd8153faaf34dc53455d598a61e13ce8a986e9 (diff) |
Monitor(): free allocated memory on exit
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Monitor.c')
-rw-r--r-- | Monitor.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -124,6 +124,7 @@ int Monitor(struct mddev_dev *devlist, */ struct state *statelist = NULL; + struct state *st2; int finished = 0; struct mdstat_ent *mdstat = NULL; char *mailfrom = NULL; @@ -242,6 +243,11 @@ int Monitor(struct mddev_dev *devlist, } test = 0; } + for (st2 = statelist; st2; st2 = statelist) { + statelist = st2->next; + free(st2); + } + if (pidfile) unlink(pidfile); return 0; |