Bug #38380 Memory leak in LogHandler::addHandler after fail to parse params
Submitted: 25 Jul 2008 16:10 Modified: 5 Oct 2008 16:26
Reporter: Magnus Blåudd Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:MySQL Cluster 6.2 OS:Any
Assigned to: Magnus Blåudd CPU Architecture:Any

[25 Jul 2008 16:10] Magnus Blåudd
Description:
If 'LogHandler->parseParams' fails the handler will not be freed before return from the function "Logger::addHandler'

How to repeat:
MCI

Suggested fix:
   if(!handler->parseParams(params))
    {
      *err= handler->getErrorCode();
      if(handler->getErrorStr())
        strncpy(errStr, handler->getErrorStr(), len);
      delete handler; <<
      DBUG_RETURN(false);
    }
[25 Jul 2008 16:10] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/50515

2635 Magnus Svensson	2008-07-25
      Bug #38380  Memory leak in LogHandler::addHandler after fail to parse params
[25 Jul 2008 16:18] Magnus Blåudd
Workaround is to not add a log handler with wrong parameters.
[25 Jul 2008 16:58] Magnus Blåudd
Pushed to 5.1-telco-6.2, 6.3 and 6.4
[11 Sep 2008 18:13] Jon Stephens
Documented bugfix in the NDB 6.2.16 and 6.3.17 changelogs as follows:

        Failure to parse configuration parameters could cause a memory leak in
        the NDB log parser.
[5 Oct 2008 16:26] Jon Stephens
Already documented, so status -> Closed.
[12 Dec 2008 23:27] Bugs System
Pushed into 6.0.6-alpha  (revid:msvensson@mysql.com-20080725161036-qlqbcdbr3avrj5xh) (version source revid:jonas@mysql.com-20080812185642-1nevjb94zj621dqx) (pib:5)