mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/fix_memory_leak_in_hidh_v4.4' into 'release/v4.4'
Fix memory leak in bt_hidh.c[backport 4.4] See merge request espressif/esp-idf!19007
This commit is contained in:
commit
b68fd2b88f
@ -803,8 +803,13 @@ static esp_err_t esp_bt_hidh_dev_report_write(esp_hidh_dev_t *dev, size_t map_in
|
||||
data = p_data;
|
||||
len = len + 1;
|
||||
}
|
||||
|
||||
ret = esp_bt_hid_host_send_data(dev->bda, data, len);
|
||||
if (p_data) {
|
||||
free(p_data);
|
||||
}
|
||||
} while (0);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -845,11 +850,17 @@ static esp_err_t esp_bt_hidh_dev_set_report(esp_hidh_dev_t *dev, size_t map_inde
|
||||
data = p_data;
|
||||
len = len + 1;
|
||||
}
|
||||
|
||||
ret = esp_bt_hid_host_set_report(dev->bda, report_type, data, len);
|
||||
if (p_data) {
|
||||
free(p_data);
|
||||
}
|
||||
|
||||
if (ret == ESP_OK) {
|
||||
set_trans(dev, ESP_HID_TRANS_SET_REPORT);
|
||||
}
|
||||
} while (0);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user