gatt: Fix not cleaning up when disconnected
authorBernie Conrad <bernie@allthenticate.net>
Tue, 28 Sep 2021 23:00:15 +0000 (16:00 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:37 +0000 (19:08 +0530)
commit7f2cfc592cc79789502f7f242359b5da894ec11a
treebd4c918eee4c9c8f25aa060e7638e4eed70df007
parent3f4b4130dc7ea783d0c7ffa1318b7d7879e66bd0
gatt: Fix not cleaning up when disconnected

There is a current use after free possible on a gatt server if a client
disconnects while a WriteValue call is being processed with dbus.

This patch includes the addition of a pending disconnect callback to handle
cleanup better if a disconnect occurs during a write, an acquire write
or read operation using bt_att_register_disconnect with the cb.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
src/gatt-database.c