Fix: memory leak when parsing (strgen) commands by moving to C++ containers
This commit is contained in:
@@ -270,10 +270,9 @@ static void ExtractStringParams(const StringData &data, StringParamsList ¶ms
|
||||
|
||||
if (ls != nullptr) {
|
||||
StringParams ¶m = params.emplace_back();
|
||||
ParsedCommandStruct pcs;
|
||||
ExtractCommandString(&pcs, ls->english.c_str(), false);
|
||||
ParsedCommandStruct pcs = ExtractCommandString(ls->english.c_str(), false);
|
||||
|
||||
for (const CmdStruct *cs : pcs.cmd) {
|
||||
for (const CmdStruct *cs : pcs.consuming_commands) {
|
||||
if (cs == nullptr) break;
|
||||
param.emplace_back(GetParamType(cs), cs->consumes);
|
||||
}
|
||||
|
Reference in New Issue
Block a user