Data provided by profiles using MCAP may fall in memory leak if
control channel is closed before reply arrives from remote side.
This patch add a GDestroyNotify function parameter in MCAP API
to release private data provided by upper layers even if adapter
is removed or control channels is closed before reply from remote
side arrives.
Profiles using MCAP should be able to free private data provided when
connecting both (data and control channels) even if connections process
is not success.
Regression caused by e7daece858:
==23899== Use of uninitialised value of size 4
==23899== at 0x49CD888: _itoa_word (_itoa.c:196)
==23899== by 0x49D1109: vfprintf (vfprintf.c:1613)
==23899== by 0x4A7506C: __vsprintf_chk (vsprintf_chk.c:86)
==23899== by 0x4A74FAC: __sprintf_chk (sprintf_chk.c:33)
==23899== by 0x4830E08: ba2str (stdio2.h:34)
==23899== by 0x1496B3: set_pin_length (security.c:514)
==23899== by 0x168399: pincode_cb (dbus-hci.c:179)
==23899== by 0x162E0D: pincode_cb (device.c:2135)
==23899== by 0x15AD55: pincode_reply (agent.c:416)
==23899== by 0x49467E0: ??? (in /lib/libdbus-1.so.3.5.2)
==23899== by 0x4934975: ??? (in /lib/libdbus-1.so.3.5.2)
==23899== by 0x4937B81: dbus_connection_dispatch (in /lib/libdbus-1.so.3.5.2)
==23899==
==23899== Conditional jump or move depends on uninitialised value(s)
==23899== at 0x49CD893: _itoa_word (_itoa.c:196)
==23899== by 0x49D1109: vfprintf (vfprintf.c:1613)
==23899== by 0x4A7506C: __vsprintf_chk (vsprintf_chk.c:86)
==23899== by 0x4A74FAC: __sprintf_chk (sprintf_chk.c:33)
==23899== by 0x4830E08: ba2str (stdio2.h:34)
==23899== by 0x1496B3: set_pin_length (security.c:514)
==23899== by 0x168399: pincode_cb (dbus-hci.c:179)
==23899== by 0x162E0D: pincode_cb (device.c:2135)
==23899== by 0x15AD55: pincode_reply (agent.c:416)
==23899== by 0x49467E0: ??? (in /lib/libdbus-1.so.3.5.2)
==23899== by 0x4934975: ??? (in /lib/libdbus-1.so.3.5.2)
==23899== by 0x4937B81: dbus_connection_dispatch (in /lib/libdbus-1.so.3.5.2)
When a pincode was entered and no DBus error ocurred, bluetoothd
still responded with Pin Code Request Negative Reply.
The regression was introduced by commit
e7daece858
Fix interleave discovery type verification. This patch fix the wrong
scanning request for LE only devices. When the adapter state changes
to idle, the next scanning window for LE only should be triggered by
the scheduler.
Periodic inquiry doesn't send an event between inquiry windows. If
devices are not found during the inquiry session or if the state is
resolving name periodic inquiry still active and needs be deactivated.