diff --git a/components/esp_partition/partition_linux.c b/components/esp_partition/partition_linux.c index 3cf497d367..cf6d6ccc9f 100644 --- a/components/esp_partition/partition_linux.c +++ b/components/esp_partition/partition_linux.c @@ -231,6 +231,7 @@ esp_err_t esp_partition_file_mmap(const uint8_t **part_desc_addr_start) if (fseek(f_partition_table, 0L, SEEK_END) != 0) { ESP_LOGE(TAG, "Failed to seek in partition table file %s: %s", s_esp_partition_file_mmap_ctrl_act.partition_file_name, strerror(errno)); ret = ESP_ERR_INVALID_SIZE; + fclose(f_partition_table); break; } @@ -244,6 +245,7 @@ esp_err_t esp_partition_file_mmap(const uint8_t **part_desc_addr_start) (uint32_t) s_esp_partition_file_mmap_ctrl_act.flash_file_size, (int) (partition_table_file_size + ESP_PARTITION_TABLE_OFFSET)); ret = ESP_ERR_INVALID_SIZE; + fclose(f_partition_table); break; } @@ -251,6 +253,7 @@ esp_err_t esp_partition_file_mmap(const uint8_t **part_desc_addr_start) if (fseek(f_partition_table, 0L, SEEK_SET) != 0) { ESP_LOGE(TAG, "Failed to seek in partition table file %s: %s", s_esp_partition_file_mmap_ctrl_act.partition_file_name, strerror(errno)); ret = ESP_ERR_INVALID_SIZE; + fclose(f_partition_table); break; } @@ -667,7 +670,7 @@ static bool esp_partition_hook_erase(const void *dstAddr, size_t *size) } } - // update statistcs for all sectors until power down cycle + // update statistics for all sectors until power down cycle for (size_t sector_index = first_sector_idx; sector_index < first_sector_idx + sector_count; sector_index++) { ++s_esp_partition_stat_erase_ops; s_esp_partition_stat_sector_erase_count[sector_index]++; diff --git a/components/freertos/FreeRTOS-Kernel-SMP/portable/linux/utils/wait_for_event.c b/components/freertos/FreeRTOS-Kernel-SMP/portable/linux/utils/wait_for_event.c index d3e5f03226..85a17ca58b 100644 --- a/components/freertos/FreeRTOS-Kernel-SMP/portable/linux/utils/wait_for_event.c +++ b/components/freertos/FreeRTOS-Kernel-SMP/portable/linux/utils/wait_for_event.c @@ -34,6 +34,7 @@ #include #include #include +#include #include "wait_for_event.h" @@ -47,7 +48,7 @@ struct event struct event * event_create() { struct event * ev = malloc( sizeof( struct event ) ); - + assert(ev != NULL); ev->event_triggered = false; pthread_mutex_init( &ev->mutex, NULL ); pthread_cond_init( &ev->cond, NULL ); diff --git a/components/freertos/FreeRTOS-Kernel/portable/linux/utils/wait_for_event.c b/components/freertos/FreeRTOS-Kernel/portable/linux/utils/wait_for_event.c index ae20cf667e..19d225ba62 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/linux/utils/wait_for_event.c +++ b/components/freertos/FreeRTOS-Kernel/portable/linux/utils/wait_for_event.c @@ -34,6 +34,7 @@ #include #include #include +#include #include "wait_for_event.h" @@ -47,7 +48,7 @@ struct event struct event * event_create(void) { struct event * ev = malloc( sizeof( struct event ) ); - + assert(ev != NULL); ev->event_triggered = false; pthread_mutex_init( &ev->mutex, NULL ); pthread_cond_init( &ev->cond, NULL );