diff options
Diffstat (limited to 'ndb/src/kernel/vm/Configuration.cpp')
-rw-r--r-- | ndb/src/kernel/vm/Configuration.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp index 02f4f2a9b98..29455e5b115 100644 --- a/ndb/src/kernel/vm/Configuration.cpp +++ b/ndb/src/kernel/vm/Configuration.cpp @@ -154,6 +154,7 @@ Configuration::Configuration() m_config_retriever= 0; m_clusterConfig= 0; m_clusterConfigIter= 0; + m_mgmd_host= NULL; } Configuration::~Configuration(){ @@ -166,6 +167,9 @@ Configuration::~Configuration(){ if(_backupPath != NULL) free(_backupPath); + if(m_mgmd_host) + free(m_mgmd_host); + if (m_config_retriever) { delete m_config_retriever; } @@ -210,8 +214,16 @@ Configuration::fetch_configuration(){ ERROR_SET(fatal, ERR_INVALID_CONFIG, "Could not connect to ndb_mgmd", s); } - m_mgmd_port= m_config_retriever->get_mgmd_port(); - m_mgmd_host= m_config_retriever->get_mgmd_host(); + { + m_mgmd_port= m_config_retriever->get_mgmd_port(); + /** + * We copy the mgmd host as the handle is later + * destroyed, so a pointer won't work + */ + int len= strlen(m_config_retriever->get_mgmd_host()); + m_mgmd_host= (char*)malloc(sizeof(char)*len); + strcpy(m_mgmd_host,m_config_retriever->get_mgmd_host()); + } ConfigRetriever &cr= *m_config_retriever; @@ -313,7 +325,8 @@ Configuration::setupConfiguration(){ ERROR_SET(fatal, ERR_INVALID_CONFIG, "Invalid configuration fetched", "No transporters configured"); } - if(!globalTransporterRegistry.connect_client(m_config_retriever->get_mgmHandle())) + if(!globalTransporterRegistry.connect_client( + m_config_retriever->get_mgmHandlePtr())) ERROR_SET(fatal, ERR_INVALID_CONFIG, "Connection to mgmd terminated before setup was complete", "StopOnError missing"); } |