From aae57dc32a843351fb2e17721afcd841bedec0a6 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sat, 29 Oct 2022 18:01:44 +0200 Subject: fix memory leak --- stm32f091/server.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stm32f091/server.c b/stm32f091/server.c index 0e8cadf..112d23a 100644 --- a/stm32f091/server.c +++ b/stm32f091/server.c @@ -182,6 +182,7 @@ void ws_server_buffer_request_chunk_send() { } else { len = asiprintf(&cmd, "AT+CIPCLOSE=%d\r\n", g_ws_server_parser.current_channel); } + free(cmd); g_ws_server_parser.mode = WS_SERVER_LM_CMD_ECHO; @@ -222,4 +223,5 @@ void ws_server_req_respond_end(unsigned int channel) { g_ws_server_parser.mode = WS_SERVER_LM_CMD_ECHO; ws_esp8266_send((uint8_t*) cmd, len); while (!__HAL_DMA_GET_FLAG(&hdma_usart1_tx, DMA_FLAG_TC2)); + free(cmd); } -- cgit v1.2.3