Commit 87f7efe7 authored by unknown's avatar unknown

BUG#19318 valgrind: memory leak in ndb_mgmd

clean up after ConfigValuesFactory


ndb/include/util/ConfigValues.hpp:
  We now have a destructor
ndb/src/common/util/ConfigValues.cpp:
  Free m_cfg on destruct (if we've set it).
  
  Also getConfigValues() instead of m_cfg
parent 33339fa3
......@@ -96,6 +96,7 @@ public:
public:
ConfigValuesFactory(Uint32 keys = 50, Uint32 data = 10); // Initial
ConfigValuesFactory(ConfigValues * m_cfg); //
~ConfigValuesFactory();
ConfigValues * m_cfg;
ConfigValues * getConfigValues();
......
......@@ -294,6 +294,12 @@ ConfigValuesFactory::ConfigValuesFactory(ConfigValues * cfg){
}
}
ConfigValuesFactory::~ConfigValuesFactory()
{
if(m_cfg)
free(m_cfg);
}
ConfigValues *
ConfigValuesFactory::create(Uint32 keys, Uint32 data){
Uint32 sz = sizeof(ConfigValues);
......@@ -528,7 +534,7 @@ ConfigValuesFactory::extractCurrentSection(const ConfigValues::ConstIterator & c
}
}
ConfigValues * ret = fac->m_cfg;
ConfigValues * ret = fac->getConfigValues();
delete fac;
return ret;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment