summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnderson Lizardo <anderson.lizardo@openbossa.org>2014-01-11 00:47:18 -0400
committerJohan Hedberg <johan.hedberg@intel.com>2014-01-11 18:56:03 +0200
commita2c1b506f7340d5d665851ca3e7e52c2df18557e (patch)
tree5401f681cac7240cbb73ec1f4227467c6bff039c /src
parent2704b4c83bad1445ab237cad5de204d7166ae616 (diff)
attrib: Add missing g_error_free()
Also print error message.
Diffstat (limited to 'src')
-rw-r--r--src/attrib-server.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/attrib-server.c b/src/attrib-server.c
index a7ee55d16..fcc660128 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);