Fix memory issue while changing rule target dynamic

Issue #1590
This commit is contained in:
Felipe Zimmerle 2017-10-24 00:01:44 -03:00
parent 351beb0567
commit 371fc03218
No known key found for this signature in database
GPG Key ID: E6DFB08CE8B11277
2 changed files with 8 additions and 6 deletions

View File

@ -2,6 +2,8 @@
v3.0.????? - ?
---------------------------
- Fix memory issue while changing rule target dynamic
[Issue #1590 - @zimmerle, @slabber]
- Fix log while displaying the name of a dict selection by regex.
[@zimmerle]
- Setting http response code on the auditlog.

View File

@ -447,10 +447,10 @@ std::vector<std::unique_ptr<collection::Variable>> Rule::getFinalVars(
std::vector<const collection::Variable *> z;
a.second->evaluateInternal(trans, this, &z);
for (auto &y : z) {
exclusions_update_by_tag_remove.push_back(y->m_key);
exclusions_update_by_tag_remove.push_back(std::string(y->m_key));
delete y;
}
exclusions_update_by_tag_remove.push_back(a.second->m_name);
exclusions_update_by_tag_remove.push_back(std::string(a.second->m_name));
} else {
Variable *b = a.second.get();
@ -466,10 +466,10 @@ std::vector<std::unique_ptr<collection::Variable>> Rule::getFinalVars(
std::vector<const collection::Variable *> z;
a.second->evaluateInternal(trans, this, &z);
for (auto &y : z) {
exclusions_update_by_id_remove.push_back(y->m_key);
exclusions_update_by_id_remove.push_back(std::string(y->m_key));
delete y;
}
exclusions_update_by_id_remove.push_back(a.second->m_name);
exclusions_update_by_id_remove.push_back(std::string(a.second->m_name));
} else {
Variable *b = a.second.get();
variables.push_back(b);
@ -482,10 +482,10 @@ std::vector<std::unique_ptr<collection::Variable>> Rule::getFinalVars(
std::vector<const collection::Variable *> z;
variable->evaluateInternal(trans, this, &z);
for (auto &y : z) {
exclusions.push_back(y->m_key);
exclusions.push_back(std::string(y->m_key));
delete y;
}
exclusions.push_back(variable->m_name);
exclusions.push_back(std::string(variable->m_name));
}
}