mcast: fix memory leak in imf_purge()
The IGMP code buffers packets in the imf_inm->inm_scq mbufq, but does not clear this queue when struct in_mfilter is freed by imf_purge(). This can cause memory leaks if IGMPv3 is used. Purge the mbufq on imf_purge(). MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D41629
This commit is contained in:
parent
8d49fd7331
commit
fa03d37432
|
@ -915,6 +915,8 @@ imf_purge(struct in_mfilter *imf)
|
|||
imf->imf_st[0] = imf->imf_st[1] = MCAST_UNDEFINED;
|
||||
KASSERT(RB_EMPTY(&imf->imf_sources),
|
||||
("%s: imf_sources not empty", __func__));
|
||||
if (imf->imf_inm != NULL)
|
||||
mbufq_drain(&imf->imf_inm->inm_scq);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue