aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2025-10-01 09:41:25 +0000
committerKristof Provost <kp@FreeBSD.org>2025-10-01 12:09:39 +0000
commitbdb205c53ed769ad9f5e8da1ec6d05c48992dbf8 (patch)
tree02562e41cb31ce212f6da25ec1cb081fe3920cb2
parentcf583997282f962d9e8bf478667d5087f7c1f2da (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.c4
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);
}