Avoid null dereference in IotMqtt_PublishSync (#828)
Avoid null dereference in IotMqtt_PublishSync (#828)

* Avoid null dereference in IotMqtt_PublishSync

Signed-off-by: Felipe R. Monteiro <8c1759c7982c7497c6df45d3880d06a4245082d4@amazon.com>

* All variables must be declared at the start of the function

Signed-off-by: Felipe R. Monteiro <8c1759c7982c7497c6df45d3880d06a4245082d4@amazon.com>
aws/aws-iot-device-sdk-embedded-C,aws/aws-iot-device-sdk-embedded-C,aws/aws-iot-device-sdk-embedded-C