From 64d271aebb17f5eb815f32031728d4445d15a27c Mon Sep 17 00:00:00 2001 From: rrs Date: Fri, 22 Feb 2008 15:08:10 +0000 Subject: Fixes a memory leak when VRF's are in play. Submitted by: Prasad Narasimha (snprasad@cisco.com) Reviewed by: rrs --- sys/netinet/sctp_pcb.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sys') diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 0d03637..25e5c79 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -223,6 +223,10 @@ sctp_free_vrf(struct sctp_vrf *vrf) ret = atomic_fetchadd_int(&vrf->refcount, -1); if (ret == 1) { + if (vrf->vrf_addr_hash) { + SCTP_HASH_FREE(vrf->vrf_addr_hash, vrf->vrf_addr_hashmark); + vrf->vrf_addr_hash = NULL; + } /* We zero'd the count */ LIST_REMOVE(vrf, next_vrf); SCTP_FREE(vrf, SCTP_M_VRF); -- cgit v1.1