All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Iooss <nicolas.iooss@m4x.org>
To: Jakub Hrozek <jhrozek@redhat.com>
Cc: SElinux list <selinux@vger.kernel.org>
Subject: Re: [PATCH] libsemanage: Free contents of modkey in semanage_direct_remove
Date: Wed, 30 Dec 2020 10:32:00 +0100	[thread overview]
Message-ID: <CAJfZ7=nY56B_DFpjf1D5SD4E+-r2UM5_tM6dsv5tTgGu1moyKA@mail.gmail.com> (raw)
In-Reply-To: <20201217145949.1230098-1-jhrozek@redhat.com>

On Thu, Dec 17, 2020 at 4:02 PM Jakub Hrozek <jhrozek@redhat.com> wrote:
>
> semanage_direct_remove allocates struct semanage_module_key_t on
> stack, then calls semanage_module_key_set_name which allocates
> modkey->name on heap, but modkey->name wasn't free()-d anywhere,
> creating a small leak.
>
> Signed-off-by: Jakub Hrozek <jhrozek@redhat.com>

Thanks for your patch!

Acked-by: Nicolas Iooss <nicolas.iooss@m4x.org>

I merged it directly.
Nicolas

> ---
>  libsemanage/src/direct_api.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/libsemanage/src/direct_api.c b/libsemanage/src/direct_api.c
> index d2b91fb2..9a4e7938 100644
> --- a/libsemanage/src/direct_api.c
> +++ b/libsemanage/src/direct_api.c
> @@ -1951,6 +1951,7 @@ static int semanage_direct_remove(semanage_handle_t * sh, char *module_name)
>         status = semanage_direct_remove_key(sh, &modkey);
>
>  cleanup:
> +       semanage_module_key_destroy(sh, &modkey);
>         return status;
>  }
>
> --
> 2.26.2
>


      reply	other threads:[~2020-12-30  9:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-17 14:59 [PATCH] libsemanage: Free contents of modkey in semanage_direct_remove Jakub Hrozek
2020-12-30  9:32 ` Nicolas Iooss [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJfZ7=nY56B_DFpjf1D5SD4E+-r2UM5_tM6dsv5tTgGu1moyKA@mail.gmail.com' \
    --to=nicolas.iooss@m4x.org \
    --cc=jhrozek@redhat.com \
    --cc=selinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.