Linux bluetooth development
 help / color / mirror / Atom feed
From: IAROSLAV VOITOVYCH <noreply@github.com>
To: linux-bluetooth@vger.kernel.org
Subject: [bluez/bluez] 0034d2: emulator: Free hooks in btdev_destroy
Date: Sat, 10 Oct 2026 02:07:31 -0700	[thread overview]
Message-ID: <bluez/bluez/push/refs/heads/1182787/000000-0034d2@github.com> (raw)

  Branch: refs/heads/1182787
  Home:   https://github.com/bluez/bluez
  Commit: 0034d2b7501bfa0458cf8f32f4ffd4a0f4fb6e51
      https://github.com/bluez/bluez/commit/0034d2b7501bfa0458cf8f32f4ffd4a0f4fb6e51
  Author: Iaroslav Voitovych <yaroslav.voytovych@gmail.com>
  Date:   2026-10-10 (Sat, 10 Oct 2026)

  Changed paths:
    M emulator/btdev.c

  Log Message:
  -----------
  emulator: Free hooks in btdev_destroy

Hooks added with btdev_add_hook() are only freed by btdev_del_hook(),
so a hook still installed when the device is destroyed is leaked. Five
mgmt-tester cases leave one installed: "Add + Remove Device Nowait -
Success" and the four "Adv. (non-)connectable & connected" cases on the
LE emulator; one l2cap-tester case does too. They pass, but with ASan
the tester exits with status 1 because LeakSanitizer reports, for
mgmt-tester:

  Direct leak of 120 byte(s) in 5 object(s) allocated from:
    #0 in malloc
    #1 in btdev_add_hook emulator/btdev.c:8891

Free the remaining hooks in btdev_destroy().

Fixes: 37199df506f4 ("emulator: Add support for pre/post command/event hooks")



To unsubscribe from these emails, change your notification settings at https://github.com/bluez/bluez/settings/notifications

                 reply	other threads:[~2026-10-10  9:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=bluez/bluez/push/refs/heads/1182787/000000-0034d2@github.com \
    --to=noreply@github.com \
    --cc=linux-bluetooth@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox