mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
bug #16017 (memory leaks in embedded server)
There actually was 3 different problems - hash_user_connections wasn't cleaned one strdupped database name wasn't freed and stmt->mem_root wasn't cleaned as it was replased with mysql->field_alloc for result For the last one - i made the library using stmt's fields to store result if it's the case.
This commit is contained in:
@ -134,7 +134,6 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
|
||||
const char *passwd, const char *db,
|
||||
uint port, const char *unix_socket,ulong client_flag)
|
||||
{
|
||||
char *db_name;
|
||||
char name_buff[USERNAME_LENGTH];
|
||||
|
||||
DBUG_ENTER("mysql_real_connect");
|
||||
@ -197,13 +196,11 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
|
||||
|
||||
port=0;
|
||||
unix_socket=0;
|
||||
db_name = db ? my_strdup(db,MYF(MY_WME)) : NULL;
|
||||
mysql->thd= create_embedded_thd(client_flag);
|
||||
|
||||
mysql->thd= create_embedded_thd(client_flag, db_name);
|
||||
init_embedded_mysql(mysql, client_flag);
|
||||
|
||||
init_embedded_mysql(mysql, client_flag, db_name);
|
||||
|
||||
if (check_embedded_connection(mysql))
|
||||
if (check_embedded_connection(mysql, db))
|
||||
goto error;
|
||||
|
||||
if (mysql_init_charset(mysql))
|
||||
|
Reference in New Issue
Block a user