Fix use after free's

This was detected by gcc and causing the build to fail on my
Linux machine
develop
Simon Lees 2022-06-23 22:19:05 +09:30 committed by Myk
parent 2807373656
commit b0bff47f03
1 changed files with 4 additions and 4 deletions

@ -540,10 +540,10 @@ static command_result orders_import(color_ostream &out, Json::Value &orders)
}
else
{
delete order;
out << COLOR_LIGHTRED << "Invalid item subtype for imported manager order: " << enum_item_key(order->item_type) << ":" << it["item_subtype"].asString() << std::endl;
delete order;
return CR_FAILURE;
}
}
@ -716,10 +716,10 @@ static command_result orders_import(color_ostream &out, Json::Value &orders)
}
else
{
delete condition;
out << COLOR_YELLOW << "Invalid item condition item subtype for imported manager order: " << enum_item_key(condition->item_type) << ":" << it2["item_subtype"].asString() << std::endl;
delete condition;
continue;
}
}