From 7a846e9ad8618f6c91717b0c3786e7004e13491b Mon Sep 17 00:00:00 2001 From: Randall Stewart Date: Fri, 22 Feb 2008 15:08:10 +0000 Subject: [PATCH] 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(+) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 0d036374b3fd..25e5c7983932 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);