You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have a system that can accept certs configuration, then multiple calls to loadCACert or related functions will not reutilize the memory assigned.
Just a repeat of the comment I placed with that commit:
You're not checking the return value of realloc.
If the return value is not a nullptr, you should assign it to *destPtr.
If it is a nullptr, it depends on the C++ version whether it was a failed alloc or not changed (e.g. size was the same)
And no need to check if *destPtr is a nullptr, as realloc called with a nullptr acts like malloc.
If you have a system that can accept certs configuration, then multiple calls to loadCACert or related functions will not reutilize the memory assigned.
https://github.com/sguarin/arduino-esp32/blob/caa8d07aafa04441bb85e6046a795249c01d9e39/libraries/WiFiClientSecure/src/WiFiClientSecure.cpp#L304
_streamLoad()
allocates memory for new certificates. A better approach should be using realloc().
https://github.com/sguarin/arduino-esp32/blob/caa8d07aafa04441bb85e6046a795249c01d9e39/libraries/WiFiClientSecure/src/WiFiClientSecure.cpp#L290
The text was updated successfully, but these errors were encountered: