From 17735954947a452dbf272aca8a0b388a6a37317d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 6 Jul 2004 08:36:52 +0200 Subject: Fixed memory handling ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: longable when routed ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp: longable when routed ndb/src/ndbapi/NdbDictionaryImpl.cpp: Init blob count correctly ndb/src/ndbapi/NdbIndexOperation.cpp: Receiver::init ndb/src/ndbapi/NdbOperation.cpp: Receiver::init release memory --- ndb/test/src/NdbBackup.cpp | 4 ++-- ndb/test/src/NdbRestarter.cpp | 20 +++++++++----------- 2 files changed, 11 insertions(+), 13 deletions(-) (limited to 'ndb/test/src') diff --git a/ndb/test/src/NdbBackup.cpp b/ndb/test/src/NdbBackup.cpp index 169034e0c07..a7358e91892 100644 --- a/ndb/test/src/NdbBackup.cpp +++ b/ndb/test/src/NdbBackup.cpp @@ -71,7 +71,7 @@ NdbBackup::getFileSystemPathForNode(int _node_id){ */ ConfigRetriever cr; - ndb_mgm_configuration * p = cr.getConfig(host, port, 0); + ndb_mgm_configuration * p = cr.getConfig(host.c_str(), port, 0); if(p == 0){ const char * s = cr.getErrorString(); if(s == 0) @@ -156,7 +156,7 @@ NdbBackup::execRestore(bool _restore_data, snprintf(buf, 255, "ndb_restore -c \"nodeid=%d;host=%s\" -n %d -b %d %s %s .", ownNodeId, - addr, + addr.c_str(), _node_id, _backup_id, _restore_data?"-r":"", diff --git a/ndb/test/src/NdbRestarter.cpp b/ndb/test/src/NdbRestarter.cpp index b731cccb259..34184449acc 100644 --- a/ndb/test/src/NdbRestarter.cpp +++ b/ndb/test/src/NdbRestarter.cpp @@ -33,13 +33,11 @@ NdbRestarter::NdbRestarter(const char* _addr): connected(false), - addr(_addr), - host(NULL), port(-1), handle(NULL), m_config(0) { - if (addr == NULL){ + if (_addr == NULL){ LocalConfig lcfg; if(!lcfg.init()){ lcfg.printError(); @@ -60,20 +58,20 @@ NdbRestarter::NdbRestarter(const char* _addr): case MgmId_TCP: char buf[255]; snprintf(buf, 255, "%s:%d", m->data.tcp.remoteHost, m->data.tcp.port); - addr = strdup(buf); - host = strdup(m->data.tcp.remoteHost); + addr.assign(buf); + host.assign(m->data.tcp.remoteHost); port = m->data.tcp.port; + return; break; case MgmId_File: break; default: break; } - if (addr != NULL) - break; } + } else { + addr.assign(_addr); } - } NdbRestarter::~NdbRestarter(){ @@ -398,10 +396,10 @@ NdbRestarter::connect(){ g_err << "handle == NULL" << endl; return -1; } - g_info << "Connecting to mgmsrv at " << addr << endl; - if (ndb_mgm_connect(handle, addr) == -1) { + g_info << "Connecting to mgmsrv at " << addr.c_str() << endl; + if (ndb_mgm_connect(handle, addr.c_str()) == -1) { MGMERR(handle); - g_err << "Connection to " << addr << " failed" << endl; + g_err << "Connection to " << addr.c_str() << " failed" << endl; return -1; } -- cgit v1.2.1