diff options
| author | Kristof Provost <kp@FreeBSD.org> | 2025-10-01 09:41:25 +0000 |
|---|---|---|
| committer | Kristof Provost <kp@FreeBSD.org> | 2025-10-01 12:09:39 +0000 |
| commit | bdb205c53ed769ad9f5e8da1ec6d05c48992dbf8 (patch) | |
| tree | 02562e41cb31ce212f6da25ec1cb081fe3920cb2 | |
| parent | cf583997282f962d9e8bf478667d5087f7c1f2da (diff) | |
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")
| -rw-r--r-- | lib/libpfctl/libpfctl.c | 4 |
1 files changed, 4 insertions, 0 deletions
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); } |
