Linux bluetooth development
 help / color / mirror / Atom feed
* [bluez/bluez] 0034d2: emulator: Free hooks in btdev_destroy
@ 2026-10-10  9:07 IAROSLAV VOITOVYCH
  0 siblings, 0 replies; only message in thread
From: IAROSLAV VOITOVYCH @ 2026-10-10  9:07 UTC (permalink / raw)
  To: linux-bluetooth

  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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-10  9:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-10  9:07 [bluez/bluez] 0034d2: emulator: Free hooks in btdev_destroy IAROSLAV VOITOVYCH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox