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
{{ message }}
This repository was archived by the owner on Jan 29, 2023. It is now read-only.
If you use .connect() with the correct database server, but wrong user credentials, the .connect() does "server_version=malloc()" when it calls parse_handshake_packet(), but as the user is wrong, it exits, without calling the "free(server_version)".
This free(server_version) is only called at the end of the .connect().
So the bug is when the .connect() exists after parse_handshake_packet(), missing the correspondent free(server_version) at all possible exits.
A workaround for this is:
MySQL_Connection->server_version=NULL;
bool res = MySQL_Connection->connect(...);
if (res==false)
if (MySQL_Connection->server_version)
free(MySQL_Connection->server_version);
To reproduce is easy. Perform a .connect() in a loop, pointing to a correct mariadb, but with unknown user/password.
In that loop show ESP.getFreeHeap(), and you will see the memory leak.