diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -662,6 +662,11 @@ cleanup_state: /* pf_state_insert() frees the state keys. */ if (st) { + /* + * The state has not yet been inserted or the insertion has + * failed. + */ + st->timeout = PFTM_UNLINKED; pf_free_state(st); } return (error);