Skip to content

Commit

Permalink
Merge branch 'bugfix/add_NULL_value_check_bta_gattc_get_services' int…
Browse files Browse the repository at this point in the history
…o 'master'

components/bt: Add NULL value check in bta_gattc_get_service_with_uuid()

See merge request idf/esp-idf!2212
  • Loading branch information
jack0c committed Apr 20, 2018
2 parents 1c06b44 + 284f332 commit c32ccf7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions components/bt/bluedroid/bta/gatt/bta_gattc_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,11 @@ void bta_gattc_get_service_with_uuid(UINT16 conn_id, tBT_UUID *svc_uuid,
int *count)
{
const list_t* svc = bta_gattc_get_services(conn_id);
if (svc == NULL) {
*svc_db = NULL;
*count = 0;
return;
}
size_t db_size = list_length(svc);
void *buffer = osi_malloc(db_size*sizeof(btgatt_db_element_t));
if (!buffer) {
Expand Down

0 comments on commit c32ccf7

Please sign in to comment.