mirror of https://gitee.com/bigwinds/arangodb
Fixed potential memleaks in failure cases
This commit is contained in:
parent
368eeb95b3
commit
17a45c8cd3
|
@ -2068,10 +2068,10 @@ int triagens::aql::useIndexesRule (Optimizer* opt,
|
|||
try {
|
||||
if (changes.size() > 0) {
|
||||
modified = true;
|
||||
for (auto& change : changes) {
|
||||
plan->registerNode(change.second);
|
||||
plan->replaceNode(plan->getNodeById(change.first), change.second);
|
||||
// TODO properly clear changes!
|
||||
for (auto change = changes.cbegin(); change != changes.cend() ; ++change) {
|
||||
plan->registerNode(change->second);
|
||||
plan->replaceNode(plan->getNodeById(change->first), change->second);
|
||||
changes.erase(change);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue