From 0584da8840f7b0ca4f588169e58cd06246a86a41 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 2 Jun 2021 18:33:33 +0200 Subject: [PATCH] Fix free heap after last status --- tasmota/support_command.ino | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tasmota/support_command.ino b/tasmota/support_command.ino index 4f32fba20..7a7a00340 100644 --- a/tasmota/support_command.ino +++ b/tasmota/support_command.ino @@ -412,18 +412,17 @@ void CmndPower(void) void CmndStatusResponse(uint32_t index) { static String all_status = (const char*) nullptr; - if (0 == XdrvMailbox.index) { + if (0 == XdrvMailbox.index) { // Command status0 if (99 == index) { all_status.replace("}{", ","); char cmnd_status[10]; // STATUS11 snprintf_P(cmnd_status, sizeof(cmnd_status), PSTR(D_CMND_STATUS "0")); MqttPublishPayloadPrefixTopicRulesProcess_P(STAT, cmnd_status, all_status.c_str()); all_status = (const char*) nullptr; + } else { + if (0 == index) { all_status = ""; } + all_status += TasmotaGlobal.mqtt_data; } - if (0 == index) { - all_status = ""; - } - all_status += TasmotaGlobal.mqtt_data; } else if (index < 99) { char cmnd_status[10]; // STATUS11