ipfilter: Fix ip_nat memory leak and use-after-free

Unfortunately the wrong elemet is freed, also resulting in use-after-free.

PR:		255859
Submitted by:	lylgood@foxmail.com
Reported by:	lylgood@foxmail.com
MFC after:	3 days
This commit is contained in:
Cy Schubert 2021-05-25 11:54:49 -07:00
parent d72cd27518
commit 323a4e2c4e

View File

@ -6245,7 +6245,7 @@ ipf_nat_rule_deref(softc, inp)
if (n->in_tqehead[0] != NULL) {
if (ipf_deletetimeoutqueue(n->in_tqehead[0]) == 0) {
ipf_freetimeoutqueue(softc, n->in_tqehead[1]);
ipf_freetimeoutqueue(softc, n->in_tqehead[0]);
}
}