Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
3.0.2
-
None
-
None
Description
int
|
mthd_my_send_cmd(MYSQL *mysql,enum enum_server_command command, const char *arg, |
size_t length, my_bool skipp_check, void *opt_arg) |
{
|
......
|
if (IS_CONNHDLR_ACTIVE(mysql)) // <- Wrongly thinks that mysql->extension->conn_hdlr has something after free(p) at line 1920 |
{
|
result= mysql->extension->conn_hdlr->plugin->set_connection(mysql, command, arg, length, skipp_check, opt_arg); // <- Exception!!! |
if (result== -1) |
return(result); |
}
|
....
|
The problem is because mysql->extension->conn_hdlr is kept with a value after "free(p);" at line 1920.
if (mysql->extension && mysql->extension->conn_hdlr) |
{
|
MA_CONNECTION_HANDLER *p= mysql->extension->conn_hdlr;
|
p->plugin->close(mysql);
|
free(p); // <- HERE |
}
|
|
if (mysql->methods) |
mysql->methods->db_close(mysql); // <- Problem! |
Should be
if (mysql->extension && mysql->extension->conn_hdlr) |
{
|
MA_CONNECTION_HANDLER *p= mysql->extension->conn_hdlr;
|
p->plugin->close(mysql);
|
free(p);
|
mysql->extension->conn_hdlr = NULL; // <- Solution |
}
|
|
if (mysql->methods) |
mysql->methods->db_close(mysql);
|