-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Arduino OTA Updater has memory leak in certain conditions #7984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Solution to this problem is easy: add this code:
|
@DamronDan Is correct this issue can be resolved immediately and does not require Investigation. @mrengineer7777 Using See this blog post for more information on the issue.
The affected line where the memory is instantiated can be found here and the line where the memory is deleted and causes undefined behaviour can be found here. Would be nice if this could be fixed as soon as possible using the code portion above should resolve that issue. Additionally in the aforementioned code portion, the It would probably be best if the private:
...
uint8_t _skipBuffer[ENCRYPTED_BLOCK_SIZE];
... This would resolve the memory leak and the need to allocate 16 bytes on the heap, which doesn't really make sense for most use cases. I am also assuming that The question is why is the Updater even implemented that way, if the Because with the An example implementation using some of the same methods as the
|
…8671) * Fix memory leak and undefined behavour in Updater #7984 * Update error message Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Update error message Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
Board
any board using updater.cpp
Device Description
tested on many ESP32 dev boards
Hardware Configuration
mainly WLED strings, not much else.
Version
latest master (checkout manually)
IDE Name
PlatformIO
Operating System
Windows 10/11
Flash frequency
40Mhz/80Mhz
PSRAM enabled
no
Upload speed
921600, 115200
Description
On an OTA firmware attempt, if the transfer fails, and updateClass is defined statically, the buffers used for the update are not freed.
There is no destructor.
Sketch
any sketch using update.cpp
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: