Hi,
We recently updated our codebase from a very early version of the AWS IoT library to the LTS version. As such, we are using the MQTT shim V2.3.1 and FreeRTOS Shadow V2.2.3.
It appears there is a memory leak inside AwsIotShadow_TimedUpdate() when calling
/* Add a subscription to the Shadow "rejected" topic. */
status = _modifyOperationSubscriptions( pOperation->mqttConnection,
pTopicBuffer,
topicFilterLength,
callback,
IotMqtt_TimedSubscribe );
and
/* Add a subscription to the Shadow "accepted" topic. */
status = _modifyOperationSubscriptions( pOperation->mqttConnection,
pTopicBuffer,
topicFilterLength,
callback,
IotMqtt_TimedSubscribe );
in aws_iot_shadow_subscription.c.
The memory allocated inside those functions, at
pTopicFilter = IotMqtt_MallocMessage( pSubscriptionList[ i ].topicFilterLength );
inside
IotMqttError_t _IotMqtt_AddSubscriptions()
never appears to be freed!
This was observed after some long term tests and we ran out of memory. I can tell the memory allocated here is not freed because I am saving the pointer it returns, and checking for it in the free(), and it never being provided.
Does this make sense?
Thanks