git: e53632189f09 - main - pf: fix sctp normalisation cleanup

From: Kristof Provost <kp_at_FreeBSD.org>
Date: Thu, 19 Nov 2026 16:59:56 UTC
The branch main has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=e53632189f09d7b5c6664fef51cbe4429e4b3243

commit e53632189f09d7b5c6664fef51cbe4429e4b3243
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2026-11-19 13:14:36 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2026-11-19 16:59:22 +0000

    pf: fix sctp normalisation cleanup
    
    If we fail to allocate the dst scrub structure we should free the src
    one too, but we passed src rather than src->scrub.
    
    Reported by:    llm-postcr
    MFC after:      1 week
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sys/netpfil/pf/pf_norm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c
index 4683078acd48..baad40d44c8a 100644
--- a/sys/netpfil/pf/pf_norm.c
+++ b/sys/netpfil/pf/pf_norm.c
@@ -1611,7 +1611,7 @@ pf_normalize_sctp_init(struct pf_pdesc *pd, struct pf_state_peer *src,
 
 	dst->scrub = uma_zalloc(V_pf_state_scrub_z, M_ZERO | M_NOWAIT);
 	if (dst->scrub == NULL) {
-		uma_zfree(V_pf_state_scrub_z, src);
+		uma_zfree(V_pf_state_scrub_z, src->scrub);
 		return (1);
 	}