Skip to content

Commit

Permalink
fix nullcheck when unable to allocate efs context on init
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianPugh committed Oct 9, 2023
1 parent aaeccb0 commit 6f651bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/esp_littlefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ static esp_err_t esp_littlefs_init_efs(esp_littlefs_t** efs, const esp_partition
{
/* Allocate Context */
*efs = calloc(1, sizeof(esp_littlefs_t));
if (efs == NULL) {
if (*efs == NULL) {
ESP_LOGE(ESP_LITTLEFS_TAG, "esp_littlefs could not be malloced");
return ESP_ERR_NO_MEM;
}
Expand Down

0 comments on commit 6f651bb

Please sign in to comment.