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

MDEV-16093 Memory leak with triggers

Problem was that blob memory allocated in Table_trigger_list was not
properly freed
This commit is contained in:
Monty
2018-05-24 15:18:09 +03:00
parent 9e22cae1cf
commit 29dbb23fb7
3 changed files with 31 additions and 2 deletions

View File

@ -614,6 +614,7 @@ end:
#endif /* WITH_WSREP */
}
/**
Build stmt_query to write it in the bin-log
and get the trigger definer.
@ -1061,6 +1062,11 @@ Table_triggers_list::~Table_triggers_list()
for (int j= 0; j < (int)TRG_ACTION_MAX; j++)
delete bodies[i][j];
/* Free blobs used in insert */
if (record0_field)
for (Field **fld_ptr= record0_field; *fld_ptr; fld_ptr++)
(*fld_ptr)->free();
if (record1_field)
for (Field **fld_ptr= record1_field; *fld_ptr; fld_ptr++)
delete *fld_ptr;