summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2015-02-24 16:15:55 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2015-02-24 17:28:40 +0200
commit0d3d74618e8fc25cc0522aaecb10afef5ea7e4af (patch)
treef82bbf42a38b18ecad4094fef90f85c22d3fa28d /src
parent1a053b132af331e0b48434ac6a80e853b5b45e1a (diff)
downloadbluez-0d3d74618e8fc25cc0522aaecb10afef5ea7e4af.tar.gz
shared/gatt-client: Fix memory leak
The following leak happens whenever bt_gatt_client_write_long_value is called: 40 bytes in 1 blocks are definitely lost in loss record 36 of 97 at 0x4C2B946: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x437D0F: request_create (gatt-client.c:127) by 0x439C74: bt_gatt_client_write_without_response (gatt-client.c:2132) by 0x42DF61: test_signed_write (test-gatt.c:843) by 0x42EDFC: client_ready_cb (test-gatt.c:568) by 0x4391EE: notify_client_ready (gatt-client.c:977) by 0x43A761: init_complete (gatt-client.c:1278) by 0x437590: discover_descs_cb (gatt-client.c:702) by 0x434005: discovery_op_complete (gatt-helpers.c:605) by 0x434099: discover_descs_cb (gatt-helpers.c:1421) by 0x433543: handle_rsp (att.c:640) by 0x433543: can_read_data (att.c:805) by 0x44045A: watch_callback (io-glib.c:170)
Diffstat (limited to 'src')
-rw-r--r--src/shared/gatt-client.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c
index a966dd08f..cc972d661 100644
--- a/src/shared/gatt-client.c
+++ b/src/shared/gatt-client.c
@@ -2139,7 +2139,7 @@ unsigned int bt_gatt_client_write_without_response(
req->att_id = bt_att_send(client->att,
signed_write ? BT_ATT_OP_SIGNED_WRITE_CMD :
BT_ATT_OP_WRITE_CMD, pdu, sizeof(pdu),
- NULL, NULL, NULL);
+ NULL, req, request_unref);
if (!req->att_id) {
request_unref(req);
return 0;