qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: marcandre.lureau@redhat.com
Cc: qemu-devel@nongnu.org, kraxel@redhat.com
Subject: Re: [PATCH] qemu-keymap: fix a small leak
Date: Tue, 1 Oct 2024 16:31:09 +0100	[thread overview]
Message-ID: <CAFEAcA-gciih5ePjcUi6MmpY9pdaXk1q4bxA-AYzZvvJhA=fmw@mail.gmail.com> (raw)
In-Reply-To: <20241001152736.2684236-1-marcandre.lureau@redhat.com>

On Tue, 1 Oct 2024 at 16:28, <marcandre.lureau@redhat.com> wrote:
>
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Spotted thanks to ASAN:
> Direct leak of 136 byte(s) in 1 object(s) allocated from:
>     #0 0x7fd0216f7350 in calloc (/lib64/libasan.so.8+0xf7350) (BuildId: a4ad7eb954b390cf00f07fa10952988a41d9fc7a)
>     #1 0x7fd0215d5d5c in xkb_state_new (/lib64/libxkbcommon.so.0+0x1cd5c) (BuildId: 5e4eb795acbf75d373f2930e5d0e84a568225bab)
>     #2 0x5593b05bbb5d in main ../qemu-keymap.c:235
>
> SUMMARY: AddressSanitizer: 136 byte(s) leaked in 1 allocation(s).
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  qemu-keymap.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/qemu-keymap.c b/qemu-keymap.c
> index 701e4332af..603bab4661 100644
> --- a/qemu-keymap.c
> +++ b/qemu-keymap.c
> @@ -261,5 +261,6 @@ int main(int argc, char *argv[])
>              "\n"
>              "# quirks section end\n");
>
> +    xkb_state_unref(state);
>      exit(0);
>  }

https://lore.kernel.org/qemu-devel/20240723-unref-v1-1-88606ffd4552@daynix.com/
from July is similar but seems to free slightly more xkb
data structures.

-- PMM


      reply	other threads:[~2024-10-01 15:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-01 15:27 [PATCH] qemu-keymap: fix a small leak marcandre.lureau
2024-10-01 15:31 ` Peter Maydell [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='CAFEAcA-gciih5ePjcUi6MmpY9pdaXk1q4bxA-AYzZvvJhA=fmw@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=kraxel@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).