The branch main has been updated by kp:

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

commit bdb205c53ed769ad9f5e8da1ec6d05c48992dbf8
Author:     Kristof Provost <[email protected]>
AuthorDate: 2025-10-01 09:41:25 +0000
Commit:     Kristof Provost <[email protected]>
CommitDate: 2025-10-01 12:09:39 +0000

    libpfctl: fix memory leak in pfctl_get_status()
    
    Remember to also free ncounters.
    
    Fixes:          c00aca9a71 ("pf: Show pf fragment reassembly counters.")
    MFC after:      3 days
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 lib/libpfctl/libpfctl.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c
index 4b579de38ad0..8c4b26b98054 100644
--- a/lib/libpfctl/libpfctl.c
+++ b/lib/libpfctl/libpfctl.c
@@ -561,6 +561,10 @@ pfctl_free_status(struct pfctl_status *status)
                free(c->name);
                free(c);
        }
+       TAILQ_FOREACH_SAFE(c, &status->ncounters, entry, tmp) {
+               free(c->name);
+               free(c);
+       }
 
        free(status);
 }

Reply via email to