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

James Carter <[email protected]> Fri, 31 Jul 2026 13:59:12 -0400
Newsgroups org.kernel.vger.selinux
Message-ID <CAP+JOzSGULoBDEv9unxpF8V7uj+DgJndA3Fsxi5e8=m_Z5Z6jA@mail.gmail.com>
On Fri, Jul 31, 2026 at 12:20=E2=80=AFPM Stephen Smalley
<[email protected]> wrote:
>
> Free all the strings on the exit path.
>
> Reported-by: oss-fuzz (issue 539257834)
> Signed-off-by: Stephen Smalley <[email protected]>

Acked-by: James Carter <[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
>