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:	db3b39f063 ("libjail: extend struct handlers [...]")
This commit is contained in:
Kyle Evans
2026-02-23 23:55:12 -06:00
parent b4305c90a3
commit 686280c0fd
+1 -1
View File
@@ -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);
}
}