From 33045da61f646701ec8e43b93e2e96d27c52f38c Mon Sep 17 00:00:00 2001 From: Gowtham Anandha Babu Date: Fri, 19 Dec 2014 19:31:28 +0530 Subject: [PATCH] src/att: Fix usage of memory after it is freed. warning: Use of memory after it is freed respond_not_supported(att, opcode); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- src/shared/att.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/att.c b/src/shared/att.c index 4be065284..a98909e27 100644 --- a/src/shared/att.c +++ b/src/shared/att.c @@ -692,14 +692,14 @@ static void handle_notify(struct bt_att *att, uint8_t opcode, uint8_t *pdu, queue_foreach(att->notify_list, notify_handler, &data); - bt_att_unref(att); - /* * If this was a request and no handler was registered for it, respond * with "Not Supported" */ if (!data.handler_found && get_op_type(opcode) == ATT_OP_TYPE_REQ) respond_not_supported(att, opcode); + + bt_att_unref(att); } static bool can_read_data(struct io *io, void *user_data) -- 2.47.3