mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'fix/fatfs_expand_files_api_leak' into 'master'
fix(fatfs): Fix leak of malloced FIL struct Closes IDF-9422 and IDF-9427 See merge request espressif/esp-idf!29585
This commit is contained in:
commit
559854bdac
@ -1348,10 +1348,12 @@ esp_err_t esp_vfs_fat_create_contiguous_file(const char* base_path, const char*
|
||||
}
|
||||
|
||||
_lock_release(&fat_ctx->lock);
|
||||
free(file);
|
||||
|
||||
return 0;
|
||||
fail:
|
||||
_lock_release(&fat_ctx->lock);
|
||||
free(file);
|
||||
ESP_LOGD(TAG, "%s: fresult=%d", __func__, res);
|
||||
errno = fresult_to_errno(res);
|
||||
return -1;
|
||||
@ -1432,10 +1434,12 @@ esp_err_t esp_vfs_fat_test_contiguous_file(const char* base_path, const char* fu
|
||||
}
|
||||
|
||||
_lock_release(&fat_ctx->lock);
|
||||
free(file);
|
||||
|
||||
return 0;
|
||||
fail:
|
||||
_lock_release(&fat_ctx->lock);
|
||||
free(file);
|
||||
ESP_LOGD(TAG, "%s: fresult=%d", __func__, res);
|
||||
errno = fresult_to_errno(res);
|
||||
return -1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user