fix(console): delete state_mux when REPL creation fails

This commit is contained in:
Yogesh Mantri
2026-09-10 10:12:00 +00:00
parent 4532e7e8c8
commit a287bbc25e
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -334,6 +334,10 @@ esp_err_t esp_console_new_repl_stdio(const esp_console_repl_config_t *repl_confi
_exit:
if (universal_repl) {
esp_console_deinit();
/* Only common_deinit() deletes state_mux, and the weak set_event_fd() never creates it. */
if (universal_repl->repl_com.state_mux) {
vSemaphoreDelete(universal_repl->repl_com.state_mux);
}
free(universal_repl);
}
if (ret_repl) {
@@ -152,6 +152,10 @@ static esp_err_t esp_console_new_repl_uart_legacy(const esp_console_dev_uart_con
_exit:
if (uart_repl) {
esp_console_deinit();
/* Only common_deinit() deletes state_mux, and the weak set_event_fd() never creates it. */
if (uart_repl->repl_com.state_mux) {
vSemaphoreDelete(uart_repl->repl_com.state_mux);
}
free(uart_repl);
}
if (ret_repl) {