Diff between f1069c4fe1060dec1565eef3d2b1ec31ed713fba and eb47cb5a04cb1db3b87374c0cda799b7e3ef65af

Changed Files

File Additions Deletions Status
monitor/att.c +4 -2 modified

Full Patch

diff --git a/monitor/att.c b/monitor/att.c
index f1af420..10d3d9e 100644
--- a/monitor/att.c
+++ b/monitor/att.c
@@ -542,7 +542,7 @@ static void att_read_req(const struct l2cap_frame *frame)
 		return;
 
 	handler = get_handler(attr);
-	if (!handler)
+	if (!handler || !handler->read)
 		return;
 
 	conn = packet_get_conn_data(frame->handle);
@@ -581,11 +581,13 @@ static void att_read_rsp(const struct l2cap_frame *frame)
 
 	data = conn->data;
 
-	read = queue_find(data->reads, match_read_frame, frame);
+	read = queue_remove_if(data->reads, match_read_frame, (void *)frame);
 	if (!read)
 		return;
 
 	read->func(frame);
+
+	free(read);
 }
 
 static void att_read_blob_req(const struct l2cap_frame *frame)