mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
esp_hid: fix memory leak if getting dev reports fails
This commit is contained in:
parent
d7fb9d54ba
commit
65b993234d
@ -301,6 +301,7 @@ esp_err_t esp_hidh_dev_reports_get(esp_hidh_dev_t *dev, size_t *num_reports, esp
|
||||
for (uint8_t i = 0; i < dev->reports_len; i++) {
|
||||
if (dr == NULL) {
|
||||
//error
|
||||
free(r);
|
||||
return ESP_FAIL;
|
||||
}
|
||||
r[i].map_index = dr->map_index;
|
||||
|
Loading…
Reference in New Issue
Block a user