-
Notifications
You must be signed in to change notification settings - Fork 10
NTPCLient.ino doesn't free the char buffer allocated inside NTPClient::getTimeDate #3
Comments
Thanks for spotting this one! I've missed that probably. Adding a |
Yes, that is, delete() does the trick. But of course I walked right into it. |
I tried to deallocate the buffer using the |
Would you maybe show your output of the lost bytes of the heap and how you have tested it? It may help me further debugging this. Thanks! |
Please see the attached files. NTPClient_no_delete.ino - your original example, with a line added to show heap size. Hope this helps |
The example program NTPClient repeatedly calls const char *NTPClient::getTimeDate(time_t tm).
This method allocates a char buffer and returns a pointer to this buffer to the caller.
NTPClient.ino should free these pointers but doesn't.
The (demonstrated) result is that 24 bytes of the heap is lost on each call of getTimeDate () and the program finally crashes.
The text was updated successfully, but these errors were encountered: