]> granicus.if.org Git - esp-idf/commitdiff
fatfs: fix double free in bailout path of esp_vfs_fat_sdmmc_mount
authorIvan Grokhotkov <ivan@espressif.com>
Mon, 11 Dec 2017 03:06:29 +0000 (11:06 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Mon, 11 Dec 2017 03:07:08 +0000 (11:07 +0800)
Fixes https://github.com/espressif/esp-idf/issues/1370

components/fatfs/src/vfs_fat_sdmmc.c

index 68751cb50f899821e5c39b4195cdd00dda8d4978..5e79d4a9f8f2d4f16c1f6ee935f0d1e975f026a9 100644 (file)
@@ -128,6 +128,7 @@ esp_err_t esp_vfs_fat_sdmmc_mount(const char* base_path,
             goto fail;
         }
         free(workbuf);
+        workbuf = NULL;
         ESP_LOGW(TAG, "mounting again");
         res = f_mount(fs, drv, 0);
         if (res != FR_OK) {