From 6fbe80c19fb50b53ad22ee3d2d7c45597029b0ed Mon Sep 17 00:00:00 2001 From: kp Date: Sat, 1 Apr 2017 12:22:34 +0000 Subject: [PATCH] pf: Fix leak of pf_state_keys If we hit the state limit we returned from pf_create_state() without cleaning up. PR: 217997 Submitted by: Max MFC after: 1 week --- sys/netpfil/pf/pf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index cf5d15984674..7d6c53d94565 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -3559,7 +3559,7 @@ pf_create_state(struct pf_rule *r, struct pf_rule *nr, struct pf_rule *a, (counter_u64_fetch(r->states_cur) >= r->max_states)) { counter_u64_add(V_pf_status.lcounters[LCNT_STATES], 1); REASON_SET(&reason, PFRES_MAXSTATES); - return (PF_DROP); + goto csfailed; } /* src node for filter rule */ if ((r->rule_flag & PFRULE_SRCTRACK ||