diff options
author | Monty <monty@mariadb.org> | 2018-05-24 15:18:09 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2018-05-26 12:49:25 +0300 |
commit | 29dbb23fb7ac3b10e70e4c5f99dcedab91af85ba (patch) | |
tree | b578de6ca6abf3d7956cb932b5775235a29574d7 /sql | |
parent | 9e22cae1cfcb4fce7a6469e9b136d599efe6b87c (diff) | |
download | mariadb-git-29dbb23fb7ac3b10e70e4c5f99dcedab91af85ba.tar.gz |
MDEV-16093 Memory leak with triggers
Problem was that blob memory allocated in Table_trigger_list was not
properly freed
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_trigger.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index 293a4c17156..bbcc75718a3 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -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; |