fix(fatfs): free allocated memory for base path before unmounting the card

This commit is contained in:
sonika.rathi 2023-09-08 13:28:04 +02:00
parent aaa438a3a2
commit 91eada4acc

View File

@ -439,6 +439,8 @@ esp_err_t esp_vfs_fat_sdcard_unmount(const char *base_path, sdmmc_card_t *card)
if (!found) { if (!found) {
return ESP_ERR_INVALID_ARG; return ESP_ERR_INVALID_ARG;
} }
free(s_ctx[id]->base_path);
s_ctx[id]->base_path = NULL;
free(s_ctx[id]); free(s_ctx[id]);
s_ctx[id] = NULL; s_ctx[id] = NULL;