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
If f_mount() failes we will goto fail and in this case free(workbuf) will be called twice. We should reset workbuf pointer with workbuf=NULL after first call.
...
free(workbuf); // first call
workbuf = NULL; // <-- missed
ESP_LOGW(TAG, "mounting again");
res = f_mount(fs, drv, 0);
if (res != FR_OK) {
err = ESP_FAIL;
ESP_LOGD(TAG, "f_mount failed after formatting (%d)", res);
goto fail;
}
}
return ESP_OK;
fail:
sdmmc_host_deinit();
free(workbuf); // second call
if (fs) {
f_mount(NULL, drv, 0);
}
...
The text was updated successfully, but these errors were encountered:
FayeY
changed the title
esp_vfs_fat_sdmmc_mount(): double call to free() is possible
[TW#17011] esp_vfs_fat_sdmmc_mount(): double call to free() is possible
Dec 14, 2017
If f_mount() failes we will goto fail and in this case free(workbuf) will be called twice. We should reset workbuf pointer with workbuf=NULL after first call.
The text was updated successfully, but these errors were encountered: