You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A small amount of memory allocated in esp_vfs_fat_sdmmc_mount will never be released, if the proc errors out via goto fail.
In esp_vfs_fat_sdmmc_mount, s_base_path = strdup(base_path) allocates memory. Then, if there is an error, the function performs a goto fail pattern, where all previously allocated resources should be released - it just misses s_base_path.
While the leak is small, there are scenarios where esp_vfs_fat_sdmmc_mount gets called multiple times and fails because the user inserted an invalid SD card
or the app uses a poor mans strategy to query for a plugged SD card by polling esp_vfs_fat_sdmmc_mount.
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
Memory leak in vfs_fat_sdmmc#esp_vfs_fat_sdmmc_mount
Memory leak in vfs_fat_sdmmc#esp_vfs_fat_sdmmc_mount (IDFGH-1969)
Oct 5, 2019
A small amount of memory allocated in
esp_vfs_fat_sdmmc_mount
will never be released, if the proc errors out viagoto fail
.In esp_vfs_fat_sdmmc_mount,
s_base_path = strdup(base_path)
allocates memory. Then, if there is an error, the function performs agoto fail
pattern, where all previously allocated resources should be released - it just missess_base_path
.While the leak is small, there are scenarios where
esp_vfs_fat_sdmmc_mount
gets called multiple times and fails because the user inserted an invalid SD cardor the app uses a poor mans strategy to query for a plugged SD card by polling
esp_vfs_fat_sdmmc_mount
.And easy to fix obviously:
Best,
Markus
The text was updated successfully, but these errors were encountered: