Skip to content

Commit

Permalink
Merge pull request #32 from espressif/fix/tinyusb_vfs_mem_leak
Browse files Browse the repository at this point in the history
fix(esp_tinyusb): Close lazy-initialized newlib locks
  • Loading branch information
tore-espressif authored Apr 23, 2024
2 parents d468531 + 654be60 commit 84b1011
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion device/esp_tinyusb/vfs_tinyusb.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -102,6 +102,8 @@ static esp_err_t vfstusb_init(int cdc_intf, char const *path)
*/
static void vfstusb_deinit(void)
{
_lock_close(&(s_vfstusb.write_lock));
_lock_close(&(s_vfstusb.read_lock));
memset(&s_vfstusb, 0, sizeof(s_vfstusb));
}

Expand Down

0 comments on commit 84b1011

Please sign in to comment.