mirror of https://gitee.com/bigwinds/arangodb
Fix memleaks in coordinator.
This commit is contained in:
parent
c87575ce33
commit
1dea6b29a5
|
@ -1452,7 +1452,7 @@ int ClusterInfo::ensureIndexCoordinator (string const& databaseName,
|
||||||
const double endTime = TRI_microtime() + realTimeout;
|
const double endTime = TRI_microtime() + realTimeout;
|
||||||
const double interval = getPollInterval();
|
const double interval = getPollInterval();
|
||||||
|
|
||||||
resultJson = 0;
|
resultJson = nullptr;
|
||||||
TRI_json_t* newIndex = nullptr;
|
TRI_json_t* newIndex = nullptr;
|
||||||
int numberOfShards = 0;
|
int numberOfShards = 0;
|
||||||
|
|
||||||
|
|
|
@ -652,7 +652,8 @@ void RestReplicationHandler::handleCommandBatch () {
|
||||||
TRI_json_t json;
|
TRI_json_t json;
|
||||||
TRI_InitObjectJson(TRI_CORE_MEM_ZONE, &json);
|
TRI_InitObjectJson(TRI_CORE_MEM_ZONE, &json);
|
||||||
char* idString = TRI_StringUInt64((uint64_t) id);
|
char* idString = TRI_StringUInt64((uint64_t) id);
|
||||||
TRI_Insert3ObjectJson(TRI_CORE_MEM_ZONE, &json, "id", TRI_CreateStringJson(TRI_CORE_MEM_ZONE, idString, strlen(idString)));
|
TRI_Insert3ObjectJson(TRI_CORE_MEM_ZONE, &json, "id",
|
||||||
|
TRI_CreateStringJson(TRI_CORE_MEM_ZONE, idString, strlen(idString)));
|
||||||
|
|
||||||
generateResult(&json);
|
generateResult(&json);
|
||||||
TRI_DestroyJson(TRI_CORE_MEM_ZONE, &json);
|
TRI_DestroyJson(TRI_CORE_MEM_ZONE, &json);
|
||||||
|
@ -1832,8 +1833,8 @@ int RestReplicationHandler::processRestoreCollectionCoordinator (
|
||||||
TRI_voc_tick_t new_id_tick = ci->uniqid(1);
|
TRI_voc_tick_t new_id_tick = ci->uniqid(1);
|
||||||
string new_id = StringUtils::itoa(new_id_tick);
|
string new_id = StringUtils::itoa(new_id_tick);
|
||||||
TRI_ReplaceObjectJson(TRI_UNKNOWN_MEM_ZONE, parameters, "id",
|
TRI_ReplaceObjectJson(TRI_UNKNOWN_MEM_ZONE, parameters, "id",
|
||||||
TRI_CreateStringCopyJson(TRI_UNKNOWN_MEM_ZONE,
|
TRI_CreateStringCopyJson(TRI_UNKNOWN_MEM_ZONE,
|
||||||
new_id.c_str(), new_id.size()));
|
new_id.c_str(), new_id.size()));
|
||||||
|
|
||||||
// Now put in the primary and an edge index if needed:
|
// Now put in the primary and an edge index if needed:
|
||||||
TRI_json_t* indexes = TRI_CreateArrayJson(TRI_UNKNOWN_MEM_ZONE);
|
TRI_json_t* indexes = TRI_CreateArrayJson(TRI_UNKNOWN_MEM_ZONE);
|
||||||
|
@ -2054,6 +2055,9 @@ int RestReplicationHandler::processRestoreIndexesCoordinator (
|
||||||
TRI_json_t* res_json = nullptr;
|
TRI_json_t* res_json = nullptr;
|
||||||
res = ci->ensureIndexCoordinator(dbName, col->id_as_string(), idxDef,
|
res = ci->ensureIndexCoordinator(dbName, col->id_as_string(), idxDef,
|
||||||
true, triagens::arango::Index::Compare, res_json, errorMsg, 3600.0);
|
true, triagens::arango::Index::Compare, res_json, errorMsg, 3600.0);
|
||||||
|
if (res_json != nullptr) {
|
||||||
|
TRI_FreeJson(TRI_UNKNOWN_MEM_ZONE, res_json);
|
||||||
|
}
|
||||||
if (res != TRI_ERROR_NO_ERROR) {
|
if (res != TRI_ERROR_NO_ERROR) {
|
||||||
errorMsg = "could not create index: " + string(TRI_errno_string(res));
|
errorMsg = "could not create index: " + string(TRI_errno_string(res));
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue