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>
This commit is contained in:
parent
146e22fca4
commit
6231b43435
1 changed files with 2 additions and 0 deletions
|
@ -1515,6 +1515,7 @@ static int sdp_client_ss_search(struct bt_sdp_client *session,
|
|||
break;
|
||||
default:
|
||||
LOG_ERR("Unknown UUID type %u", param->uuid->type);
|
||||
net_buf_unref(buf);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -1620,6 +1621,7 @@ static int sdp_client_ssa_search(struct bt_sdp_client *session,
|
|||
break;
|
||||
default:
|
||||
LOG_ERR("Unknown UUID type %u", param->uuid->type);
|
||||
net_buf_unref(buf);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue