I am using the AWS OTA Demo , modified with a time out if no update is found at power up. This means it can exit and get on with other things such as shadow or MQTT , this is working as expected with no issues and updates OTA work just fine.
The problem occurs when I run AWS OTA Demo from within the main program loop , I end up with a memory leak every time the OTA demo is run and eventually it crashes (out of memory).
To get it to run the subscriptions again , I add the following
xOTA_Agent.eState = eOTA_AgentState_Stopped;
xOTA_Agent.eImageState = eOTA_ImageState_Unknown;
to make it do a restart, without this it does not subscribe to the OTA topic and the demo timeouts out without any memory leak.
I cannot see were the leak is occurring or how to resolve the problem
any ideas welcome