[PATCH] libsepol: fix direct leak in user_extra_to_cil()

Stephen Smalley <[email protected]> Fri, 31 Jul 2026 12:20:33 -0400
Newsgroups org.kernel.vger.selinux
Message-ID <[email protected]>
Free all the strings on the exit path.

Reported-by: oss-fuzz (issue 539257834)
Signed-off-by: Stephen Smalley <[email protected]>
---
 libsepol/src/module_to_cil.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libsepol/src/module_to_cil.c b/libsepol/src/module_to_cil.c
index 2aaf4feb..06fbdc30 100644
--- a/libsepol/src/module_to_cil.c
+++ b/libsepol/src/module_to_cil.c
@@ -3680,6 +3680,8 @@ exit:
 	free(line);
 	free(user);
 	free(prefix);
+	free(user_str);
+	free(prefix_str);
 
 	return rc;
 }
-- 
2.55.0