diff --git a/components/driver/i2s.c b/components/driver/i2s.c index f78745f329..1816a55e82 100644 --- a/components/driver/i2s.c +++ b/components/driver/i2s.c @@ -435,7 +435,7 @@ static i2s_dma_t *i2s_create_dma_queue(i2s_port_t i2s_num, int dma_buf_count, in dma->buf = (char **)malloc(sizeof(char*) * dma_buf_count); if (dma->buf == NULL) { ESP_LOGE(I2S_TAG, "Error malloc dma buffer pointer"); - + free(dma); return NULL; } memset(dma->buf, 0, sizeof(char*) * dma_buf_count); diff --git a/components/fatfs/src/vfs_fat_spiflash.c b/components/fatfs/src/vfs_fat_spiflash.c index 03682e564e..b9f80354a1 100644 --- a/components/fatfs/src/vfs_fat_spiflash.c +++ b/components/fatfs/src/vfs_fat_spiflash.c @@ -83,6 +83,7 @@ esp_err_t esp_vfs_fat_spiflash_mount(const char* base_path, goto fail; } free(workbuf); + workbuf = NULL; ESP_LOGI(TAG, "Mounting again"); fresult = f_mount(fs, drv, 0); if (fresult != FR_OK) { diff --git a/components/mdns/mdns.c b/components/mdns/mdns.c index 01e7b91d33..40b4c70961 100644 --- a/components/mdns/mdns.c +++ b/components/mdns/mdns.c @@ -1755,6 +1755,7 @@ esp_err_t mdns_service_add(mdns_server_t * server, const char * service, const c item = (mdns_srv_item_t *)malloc(sizeof(mdns_srv_item_t)); if (!item) { + free(s); return ESP_ERR_NO_MEM; }