patch-2.3.99-pre7 linux/net/ipv4/netfilter/ip_tables.c

Next file: linux/net/ipv4/netfilter/ipt_LOG.c
Previous file: linux/net/ipv4/netfilter/ip_fw_compat_masq.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre6/linux/net/ipv4/netfilter/ip_tables.c linux/net/ipv4/netfilter/ip_tables.c
@@ -589,6 +589,9 @@
 	if (i && (*i)-- == 0)
 		return 1;
 
+	if (m->u.match->destroy)
+		m->u.match->destroy(m->data, m->match_size - sizeof(*m));
+
 	if (m->u.match->me)
 		__MOD_DEC_USE_COUNT(m->u.match->me);
 
@@ -769,6 +772,8 @@
 	/* Cleanup all matches */
 	IPT_MATCH_ITERATE(e, cleanup_match, NULL);
 	t = ipt_get_target(e);
+	if (t->u.target->destroy)
+		t->u.target->destroy(t->data, t->target_size - sizeof(*t));
 	if (t->u.target->me)
 		__MOD_DEC_USE_COUNT(t->u.target->me);
 
@@ -1094,7 +1099,7 @@
 	/* Silent error: too late now. */
 	copy_to_user(tmp.counters, counters,
 		     sizeof(struct ipt_counters) * tmp.num_counters);
-
+	vfree(counters);
 	up(&ipt_mutex);
 	return 0;
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)