From 5219c39d090faf6a5b8ffcf0299a8bd47138e66e Mon Sep 17 00:00:00 2001 From: Richard Allen Date: Mon, 4 Nov 2024 08:39:13 -0600 Subject: [PATCH] fix(websocket): fix example buffer leak --- .../examples/target/main/websocket_example.c | 1 + 1 file changed, 1 insertion(+) diff --git a/components/esp_websocket_client/examples/target/main/websocket_example.c b/components/esp_websocket_client/examples/target/main/websocket_example.c index 18f6545f07..d141ccbb9a 100644 --- a/components/esp_websocket_client/examples/target/main/websocket_example.c +++ b/components/esp_websocket_client/examples/target/main/websocket_example.c @@ -222,6 +222,7 @@ static void websocket_app_start(void) char *long_data = malloc(size); memset(long_data, 'a', size); esp_websocket_client_send_text(client, long_data, size, portMAX_DELAY); + free(long_data); xSemaphoreTake(shutdown_sema, portMAX_DELAY); esp_websocket_client_close(client, portMAX_DELAY);