We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6d268e3 commit 02b10cfCopy full SHA for 02b10cf
src/MqttClient.cpp
@@ -835,6 +835,15 @@ void MqttClient::setTxPayloadSize(unsigned short size)
835
{
836
// NOOJ WAS HERE
837
log_i("MqttClient::setTxPayloadSize(): NOOJ says: _txPayloadBuffer should be freed and NULLed here.");
838
+
839
+ // TODO: Be clever and try to preserve existing _txPayloadBuffer contents?
840
+ // TODO: Check if this messes up the state of pending messages
841
+ if (_txPayloadBuffer) {
842
+ free(_txPayloadBuffer);
843
+ _txPayloadBuffer = NULL;
844
+ _txPayloadBufferIndex = 0;
845
+ }
846
847
_tx_payload_buffer_size = size;
848
}
849
0 commit comments