aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-10-29 18:01:44 +0200
committerlonkaars <loek@pipeframe.xyz>2022-10-29 18:01:44 +0200
commitaae57dc32a843351fb2e17721afcd841bedec0a6 (patch)
tree85f1acd77d335c75a30df60851eed306371ccefd
parent9947b4aa803b0430e38be3bd6f7179b45b201213 (diff)
fix memory leak
-rw-r--r--stm32f091/server.c2
1 files changed, 2 insertions, 0 deletions
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);
}