Fix a leak of an address, if the address is scheduled for removal

and the stack is torn down.
Thanks to Peter Bostroem and Jiayang Liu from Google for reporting the
issue.

MFC after: 1 week
This commit is contained in:
Michael Tuexen 2014-09-06 20:03:24 +00:00
parent 27d21b9e9a
commit 24110da033
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=271209

View File

@ -5976,6 +5976,9 @@ sctp_pcb_finish(void)
LIST_FOREACH_SAFE(wi, &SCTP_BASE_INFO(addr_wq), sctp_nxt_addr, nwi) { LIST_FOREACH_SAFE(wi, &SCTP_BASE_INFO(addr_wq), sctp_nxt_addr, nwi) {
LIST_REMOVE(wi, sctp_nxt_addr); LIST_REMOVE(wi, sctp_nxt_addr);
SCTP_DECR_LADDR_COUNT(); SCTP_DECR_LADDR_COUNT();
if (wi->action == SCTP_DEL_IP_ADDRESS) {
SCTP_FREE(wi->ifa, SCTP_M_IFA);
}
SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_laddr), wi); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_laddr), wi);
} }
SCTP_WQ_ADDR_UNLOCK(); SCTP_WQ_ADDR_UNLOCK();