Diff between 2704b4c83bad1445ab237cad5de204d7166ae616 and a2c1b506f7340d5d665851ca3e7e52c2df18557e

Changed Files

File Additions Deletions Status
src/attrib-server.c +6 -4 modified

Full Patch

diff --git a/src/attrib-server.c b/src/attrib-server.c
index a7ee55d..fcc6601 100644
--- a/src/attrib-server.c
+++ b/src/attrib-server.c
@@ -944,10 +944,12 @@ static uint16_t mtu_exchange(struct gatt_channel *channel, uint16_t mtu,
 	io = g_attrib_get_channel(channel->attrib);
 
 	bt_io_get(io, &gerr, BT_IO_OPT_IMTU, &imtu, BT_IO_OPT_INVALID);
-
-	if (gerr)
-		return enc_error_resp(ATT_OP_MTU_REQ, 0,
-					ATT_ECODE_UNLIKELY, pdu, len);
+	if (gerr) {
+		error("bt_io_get: %s", gerr->message);
+		g_error_free(gerr);
+		return enc_error_resp(ATT_OP_MTU_REQ, 0, ATT_ECODE_UNLIKELY,
+								pdu, len);
+	}
 
 	channel->mtu = MIN(mtu, imtu);
 	g_attrib_set_mtu(channel->attrib, channel->mtu);