mbox series

[BlueZ,0/2] Memory leaks and memory used after free fixes

Message ID 20230927062436.6306-1-andrei.istodorescu@nxp.com
Headers show
Series Memory leaks and memory used after free fixes | expand

Message

Andrei Istodorescu Sept. 27, 2023, 6:24 a.m. UTC
This patch fixes memory leaks and usage of unallocated memory.

The endpoint is initialized after allocation, so that it will not
contain random pointers.
Rework parse_base and parse_array. Add missing unregister in
bap_exit.
Set the lpac in the stream to NULL as it is freed in another place and
will result in a dangling pointer inside the stream.

Andrei Istodorescu (2):
  bap: Remove memory leaks and buffer usage after free.
  shared/bap: Set stream lpac to NULL after removing the stream.

 profiles/audio/bap.c | 66 ++++++++++++++++++++++++++------------------
 src/shared/bap.c     |  4 ++-
 2 files changed, 42 insertions(+), 28 deletions(-)


base-commit: df658c6c4ab5bd5ec4a8a3f8faa36e0d0a5f906a
--
2.39.2