From: Oystein Grovlen Date: November 5 2012 12:10pm Subject: bzr push into mysql-trunk branch (oystein.grovlen:4735 to 4736) List-Archive: http://lists.mysql.com/commits/145146 Message-Id: <201211051210.qA5CADnV005803@khepri24.no.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 4736 Oystein Grovlen 2012-11-05 Worklog #6073: Remove INSERT DELAYED: Plug memory leak The following code was deleted from Security_context::destroy() if (user != delayed_user) { my_free(user); user= NULL; } This is of course wrong since this code was executed for every thread, EXCEPT the delayed insert thread. Instead of deleting it, it should be changed to: if (user) { my_free(user); user= NULL; } modified: sql/sql_class.cc 4735 Oystein Grovlen 2012-11-05 [merge] Merge diverged branches (overwrite had been used when pushing). modified: sql/sys_vars.cc === modified file 'sql/sql_class.cc' --- a/sql/sql_class.cc 2012-10-31 10:30:37 +0000 +++ b/sql/sql_class.cc 2012-11-05 10:50:24 +0000 @@ -3648,10 +3648,15 @@ void Security_context::destroy() my_free(host); host= NULL; } + if (user) + { + my_free(user); + user= NULL; + } if (external_user) { my_free(external_user); - user= NULL; + external_user= NULL; } my_free(ip); No bundle (reason: useless for push emails).