Iot_mqtt Ping Request memory leak?

FreeRTOS MQTT V2.3.1 with IOT_STATIC_MEMORY_ONLY == 0

On mqttConnect(), _IotMqtt_pingreqSerializeWrapper() calls IotMqtt_MallocMessage() which is pvPortMalloc() in iot_config_common.h, allocating 2 bytes.

On mqttDisconnect(), _IotMqtt_FreePacket() claims

/* Don’t call free on DISCONNECT and PINGREQ; those are allocated from static memory. */

Am I missing something or is this a bug?

Thanks

W

Hi @wrm,

Thank you for bringing this to our attention, this is does look like a memory leak as that memory should be freed. I have created a pull request to address this.

Please let us know if you have any further questions.

Thank you