Skip to content

Commit 6231b43

Browse files
lylezhu2012dkalowsk
authored andcommitted
Bluetooth: Classic: SDP: Fix buf leak issue
In the function `sdp_client_ss_search()` and `sdp_client_ssa_search()`, the allocated buf is not released if the required UUID is invalid. Un-reference the allocated net buffer if the UUID is invalid. Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
1 parent 146e22f commit 6231b43

File tree

1 file changed

+2
-0
lines changed
  • subsys/bluetooth/host/classic

1 file changed

+2
-0
lines changed

subsys/bluetooth/host/classic/sdp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,6 +1515,7 @@ static int sdp_client_ss_search(struct bt_sdp_client *session,
15151515
break;
15161516
default:
15171517
LOG_ERR("Unknown UUID type %u", param->uuid->type);
1518+
net_buf_unref(buf);
15181519
return -EINVAL;
15191520
}
15201521

@@ -1620,6 +1621,7 @@ static int sdp_client_ssa_search(struct bt_sdp_client *session,
16201621
break;
16211622
default:
16221623
LOG_ERR("Unknown UUID type %u", param->uuid->type);
1624+
net_buf_unref(buf);
16231625
return -EINVAL;
16241626
}
16251627

0 commit comments

Comments
 (0)