1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Fix leak when the client disconnects with open prep statements

This commit is contained in:
venu@myvenu.com
2003-01-28 09:24:27 -08:00
parent cb00984a41
commit 79e1fd8d0e
3 changed files with 71 additions and 50 deletions

View File

@ -5299,14 +5299,11 @@ static my_bool stmt_close(MYSQL_STMT *stmt, my_bool skip_list)
int4store(buff, stmt->stmt_id);
error= simple_command(stmt->mysql, COM_CLOSE_STMT, buff, 4, 1);
}
if (!error)
{
mysql_free_result(stmt->result);
free_root(&stmt->mem_root, MYF(0));
if (!skip_list)
stmt->mysql->stmts= list_delete(stmt->mysql->stmts, &stmt->list);
my_free((gptr) stmt, MYF(MY_WME));
}
mysql_free_result(stmt->result);
free_root(&stmt->mem_root, MYF(0));
if (!skip_list)
stmt->mysql->stmts= list_delete(stmt->mysql->stmts, &stmt->list);
my_free((gptr) stmt, MYF(MY_WME));
DBUG_RETURN(error);
}