From: Jes Sorensen Date: Tue, 1 Nov 2011 15:09:32 +0000 (+0100) Subject: Monitor(): free allocated memory on exit X-Git-Tag: mdadm-3.2.3~80 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b657208c50a8924a3b9ae2d7b2dc9bfbf37220ee;p=thirdparty%2Fmdadm.git Monitor(): free allocated memory on exit Signed-off-by: Jes Sorensen Signed-off-by: NeilBrown --- diff --git a/Monitor.c b/Monitor.c index 101bca4c..fc0488bc 100644 --- a/Monitor.c +++ b/Monitor.c @@ -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;