There's a minor memory leak in gc.c; when cleaning up a service's
matchlist, it fails to free any memory allocated by regcomp for
compiled regular expressions. The attached patch fixes this.
Josh Kelley
diff -ur monit-4.10-beta1.orig/gc.c monit-4.10-beta1/gc.c
--- monit-4.10-beta1.orig/gc.c 2007-08-12 14:02:48.000000000 -0400
+++ monit-4.10-beta1/gc.c 2007-09-09 23:02:53.000000000 -0400
@@ -477,8 +477,10 @@
FREE((*s)->match_string);
#ifdef HAVE_REGEX_H
- if((*s)->regex_comp)
+ if((*s)->regex_comp) {
+ regfree((*s)->regex_comp);
FREE((*s)->regex_comp);
+ }
#endif
FREE(*s);
_______________________________________________
monit-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/monit-dev