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

(cherry picked from commit 323a4e2c4e)
This commit is contained in:
Cy Schubert 2021-05-25 11:54:49 -07:00
parent 19cfc8e655
commit 2fb3779764

View file

@ -6243,7 +6243,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]);
}
}