mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-14 07:21:48 +00:00
Fix for linux double free error in RestoreRuleNotes()
This commit is contained in:
parent
265458a6da
commit
70ad517c14
@ -564,16 +564,16 @@ bool RuleManager::RestoreRuleNotes(Database *db)
|
|||||||
int update_count = 0;
|
int update_count = 0;
|
||||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
|
|
||||||
const auto &rule = [&row]() {
|
auto rule = [](const char *rule_name) {
|
||||||
|
|
||||||
for (const auto &rule_iter : s_RuleInfo) {
|
for (auto rule_iter : s_RuleInfo) {
|
||||||
if (strcasecmp(rule_iter.name, row[1]) == 0) {
|
if (strcasecmp(rule_iter.name, rule_name) == 0) {
|
||||||
return rule_iter;
|
return rule_iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return s_RuleInfo[_IntRuleCount+_RealRuleCount+_BoolRuleCount];
|
return s_RuleInfo[_IntRuleCount+_RealRuleCount+_BoolRuleCount];
|
||||||
}();
|
}(row[1]);
|
||||||
|
|
||||||
if (strcasecmp(rule.name, row[1]) != 0) {
|
if (strcasecmp(rule.name, row[1]) != 0) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user