Diff between 5de70880a685055bb017289fa739a97c85b681ea and b3c4f2e9d398d06271ab6454418d521e66f2e951

Changed Files

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

Full Patch

diff --git a/src/attrib-server.c b/src/attrib-server.c
index dc05d7e..98bd6b1 100644
--- a/src/attrib-server.c
+++ b/src/attrib-server.c
@@ -315,7 +315,7 @@ static uint16_t read_by_group(struct gatt_channel *channel, uint16_t start,
 					ATT_ECODE_UNSUPP_GRP_TYPE, pdu, len);
 
 	last_handle = end;
-	for (l = database, groups = NULL; l; l = l->next) {
+	for (l = database, groups = NULL, cur = NULL; l; l = l->next) {
 		struct attribute *client_attr;
 
 		a = l->data;
@@ -538,6 +538,9 @@ static int find_info(uint16_t start, uint16_t end, uint8_t *pdu, int len)
 	} else if (last_type == BT_UUID128) {
 		length = 16;
 		format = 0x02;
+	} else {
+		g_slist_free(info);
+		return 0;
 	}
 
 	adl = att_data_list_alloc(num, length + 2);