diff --git a/tasmota/tasmota_xdrv_driver/xdrv_63_modbus_bridge.ino b/tasmota/tasmota_xdrv_driver/xdrv_63_modbus_bridge.ino index 1b4f8027b..7958fe388 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_63_modbus_bridge.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_63_modbus_bridge.ino @@ -562,7 +562,7 @@ void CmndModbusBridgeSend(void) } else { - writeData = (uint16_t *)malloc(writeDataSize); + writeData = (uint16_t *)malloc(writeDataSize*2); for (uint8_t jsonDataArrayPointer = 0; jsonDataArrayPointer < writeDataSize; jsonDataArrayPointer++) { writeData[jsonDataArrayPointer] = jsonDataArray[jsonDataArrayPointer].getUInt(0);