mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-12-26 20:33:46 +08:00
android/hidhost: Shutdown ctrl_io channel if intr_io fails
This fix possible memory leak.
This commit is contained in:
parent
0ba58ed345
commit
995d19a8d4
@ -1215,8 +1215,12 @@ bool bt_hid_register(const bdaddr_t *addr)
|
||||
BT_IO_OPT_INVALID);
|
||||
if (!intr_io) {
|
||||
error("Failed to listen on intr channel: %s", err->message);
|
||||
g_io_channel_unref(ctrl_io);
|
||||
g_error_free(err);
|
||||
|
||||
g_io_channel_shutdown(ctrl_io, TRUE, NULL);
|
||||
g_io_channel_unref(ctrl_io);
|
||||
ctrl_io = NULL;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user