aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2026-02-24 05:55:12 +0000
committerKyle Evans <kevans@FreeBSD.org>2026-02-24 05:58:45 +0000
commit686280c0fdc4807676c3e8b896a1816ce62d4457 (patch)
tree73371b39f3b727f27e2fa6e482a0454c689039ba
parentb4305c90a3be7e1a40b76545b8b761fdbda5c309 (diff)
libjail: avoid a double-free in the MAC label bits
As written, we'll repeatedly jps_free() the first element, which is obviously bogus. Fix it to index appropriately. Fixes: db3b39f063d9f ("libjail: extend struct handlers [...]")
-rw-r--r--lib/libjail/jail.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libjail/jail.c b/lib/libjail/jail.c
index baabeb4afed9..95ba336b62ce 100644
--- a/lib/libjail/jail.c
+++ b/lib/libjail/jail.c
@@ -978,7 +978,7 @@ jailparam_free(struct jailparam *jp, unsigned njp)
for (j = 0; j < njp; j++) {
free(jp[j].jp_name);
if (!(jp[j].jp_flags & JP_RAWVALUE)) {
- jps_free(jp);
+ jps_free(&jp[j]);
free(jp[j].jp_value);
}
}