Fix: memory leak due to assigning result of strdup to a std::string
(cherry picked from commit 296194ad36
)
This commit is contained in:

committed by
Jonathan G Rennison

parent
bf87578173
commit
7c4d803265
@@ -2228,7 +2228,7 @@ CommandCost CmdFoundTown(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||
old_generating_world.Restore();
|
||||
|
||||
if (t != nullptr && !StrEmpty(text)) {
|
||||
t->name = stredup(text);
|
||||
t->name = text;
|
||||
t->UpdateVirtCoord();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user