From 36eccee213c5e8c992903f16d67f32c7f6ad41fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Quentin=20Th=C3=A9rond?= Date: Tue, 25 Jul 2017 14:14:03 +0200 Subject: [PATCH] i2s: fix leak in i2s_create_dma_queue if we have a malloc issue. --- components/driver/i2s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);