If write cannot be executed, remove data from queue and free allocated memory. --- android/gatt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/android/gatt.c b/android/gatt.c index e41a69e..721785a 100644 --- a/android/gatt.c +++ b/android/gatt.c @@ -4969,8 +4969,11 @@ static uint8_t write_req_request(const uint8_t *cmd, uint16_t cmd_len, } if (!gatt_db_write(gatt_db, handle, 0, value, vlen, cmd[0], - &dev->bdaddr)) + &dev->bdaddr)) { + queue_remove(dev->pending_requests, data); + free(data); return ATT_ECODE_UNLIKELY; + } return 0; } -- 1.9.0 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html