Skip to content

Commit 722e2dc

Browse files
bt_rpc: fix issue with cleaning gatt buffer after last service is removed
fixed memory leak on multiple bt init/disable calls. Signed-off-by: Robert Gałat <robert.galat@nordicsemi.no>
1 parent 9fb34cc commit 722e2dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

subsys/bluetooth/rpc/common/bt_rpc_gatt_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const struct bt_gatt_attr *bt_rpc_gatt_index_to_attr(uint32_t index)
9292

9393
const struct bt_gatt_service *bt_rpc_gatt_get_service_by_index(uint16_t svc_index)
9494
{
95-
if (svc_index > svc_cache.count) {
95+
if (svc_index >= svc_cache.count) {
9696
return NULL;
9797
}
9898

0 commit comments

Comments
 (0)