diff -ur --exclude=libipvs net-snmp-lvs-module-0.0.4/lvs.c net-snmp-lvs-module-0.0.4-leak_fix/lvs.c --- net-snmp-lvs-module-0.0.4/lvs.c 2006-01-02 14:31:54.000000000 +0000 +++ net-snmp-lvs-module-0.0.4-leak_fix/lvs.c 2010-05-13 13:54:00.000000000 +0100 @@ -37,6 +37,7 @@ static struct ip_vs_daemon_user* ipvs_daemon; static struct Destination* ipvs_destination; static time_t last_setup; +static struct ip_vs_get_dests* sentry; static void setup_snmp_ipvs(void) @@ -44,7 +45,6 @@ int s, d; struct Destination* mydestprev = NULL; struct Destination* mydest = ipvs_destination; - struct ip_vs_get_dests* sentry; time(&last_setup); if (ipvs_services) { @@ -70,6 +70,11 @@ SNMP_FREE(mydestprev); } mydestprev = NULL; + + /* NRC, 2010-05-13: Free old sentry structure... */ + if (sentry) + free(sentry); + for (s = 0; snum_services; s++) { sentry = ipvs_get_dests(&ipvs_services->entrytable[s]); for (d = 0; dnum_dests; d++) { diff -ur --exclude=libipvs net-snmp-lvs-module-0.0.4/Makefile net-snmp-lvs-module-0.0.4-leak_fix/Makefile --- net-snmp-lvs-module-0.0.4/Makefile 2006-03-02 09:14:56.000000000 +0000 +++ net-snmp-lvs-module-0.0.4-leak_fix/Makefile 2010-05-07 10:37:12.000000000 +0100 @@ -3,7 +3,7 @@ VERSDIR := $(NAME)-$(VERSION) TARFILE := $(NAME)-$(VERSION).tar.gz CC := gcc -CFLAGS := `net-snmp-config --cflags` -Ilibipvs -I/usr/src/linux/include -Wall -g +CFLAGS := `net-snmp-config --cflags` -Ilibipvs -I/usr/src/linux/include -Wall -g -fPIC DEFINES := -DHAVE_NET_IP_VS_H DLFLAGS := -fPIC -shared -g LIBS := `net-snmp-config --netsnmp-libs`