Commit c7e942a8 authored by unknown's avatar unknown

added ndb_mgm_destroy_configuration call

fixed memory leak in object map
fixed uninitialized value blobs_pending


ndb/include/mgmapi/mgmapi.h:
  added ndb_mgm_destroy_configuration call
ndb/src/mgmapi/mgmapi.cpp:
  added ndb_mgm_destroy_configuration call
ndb/src/ndbapi/ObjectMap.hpp:
  fixed memory leak
ndb/src/ndbapi/ndb_cluster_connection.cpp:
  added ndb_mgm_destroy_configuration call
sql/ha_ndbcluster.cc:
  fixed uninitialized value blobs_pending
parent 9fd78ea3
......@@ -664,10 +664,11 @@ extern "C" {
* @param handle NDB management handle.
* @param version Version of configuration, 0 means latest
* @see MAKE_VERSION
* @Note the caller must free the pointer returned.
* @Note the caller must call ndb_mgm_detroy_configuration
*/
struct ndb_mgm_configuration * ndb_mgm_get_configuration(NdbMgmHandle handle,
unsigned version);
void ndb_mgm_destroy_configuration(struct ndb_mgm_configuration *);
int ndb_mgm_alloc_nodeid(NdbMgmHandle handle,
unsigned version,
......
......@@ -1508,6 +1508,14 @@ ndb_mgm_get_configuration(NdbMgmHandle handle, unsigned int version) {
return 0;
}
extern "C"
void
ndb_mgm_destroy_configuration(struct ndb_mgm_configuration *cfg)
{
if (cfg)
delete (ConfigValues *)cfg;
}
extern "C"
int
ndb_mgm_alloc_nodeid(NdbMgmHandle handle, unsigned int version, unsigned *pnodeid, int nodetype)
......
......@@ -134,7 +134,10 @@ NdbObjectIdMap::expand(Uint32 incSize){
Uint32 newSize = m_size + incSize;
MapEntry * tmp = (MapEntry*)malloc(newSize * sizeof(MapEntry));
if (m_map) {
memcpy(tmp, m_map, m_size * sizeof(MapEntry));
free((void*)m_map);
}
m_map = tmp;
for(Uint32 i = m_size; i<newSize; i++){
......
......@@ -116,7 +116,7 @@ int Ndb_cluster_connection::connect(int reconnect)
if(props == 0)
break;
m_facade->start_instance(nodeId, props);
free(props);
ndb_mgm_destroy_configuration(props);
m_facade->connected();
DBUG_RETURN(0);
} while(0);
......
......@@ -3196,6 +3196,7 @@ ha_ndbcluster::ha_ndbcluster(TABLE *table_arg):
bulk_insert_rows(1024),
bulk_insert_not_flushed(false),
ops_pending(0),
blobs_pending(0),
skip_auto_increment(true),
blobs_buffer(0),
blobs_buffer_size(0),
......
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