mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
Fixed crashing when using DBUG_PUSH_EMPTY
DBUG_PUSH_EMPTY is used by thr_mutex.cc. If there are 4G of DBUG_PUSH_EMPTY calls, then DBUG_POP_EMPTY will cause a crash when DBUGCloseFile() will try to free an object that was never allocated.
This commit is contained in:
parent
099b9202a5
commit
392e744aec
1 changed files with 2 additions and 3 deletions
|
@ -1994,11 +1994,10 @@ static void DBUGOpenFile(CODE_STATE *cs,
|
|||
static void DBUGCloseFile(CODE_STATE *cs, sFILE *new_value)
|
||||
{
|
||||
sFILE *fp;
|
||||
if (!cs || !cs->stack || !cs->stack->out_file)
|
||||
if (!cs || !cs->stack || !(fp= cs->stack->out_file))
|
||||
return;
|
||||
|
||||
fp= cs->stack->out_file;
|
||||
if (--fp->used == 0)
|
||||
if (fp != sstdout && fp != sstderr && --fp->used == 0)
|
||||
{
|
||||
if (fclose(fp->file) == EOF)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue