From de9b0b1c56f59fc213586e4790f861c7109b4227 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Tue, 8 Oct 2019 13:17:34 +0200 Subject: [PATCH] Fix memory leak upon failure of esp_vfs_fat_sdmmc_mount() Closes https://github.com/espressif/esp-idf/issues/4165 --- components/fatfs/vfs/vfs_fat_sdmmc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/fatfs/vfs/vfs_fat_sdmmc.c b/components/fatfs/vfs/vfs_fat_sdmmc.c index 97928f7d02..888f920622 100644 --- a/components/fatfs/vfs/vfs_fat_sdmmc.c +++ b/components/fatfs/vfs/vfs_fat_sdmmc.c @@ -159,6 +159,8 @@ fail: ff_diskio_unregister(pdrv); free(s_card); s_card = NULL; + free(s_base_path); + s_base_path = NULL; return err; }