Skip to content

Commit

Permalink
Fix OpenTTD#7988: Memory leak when using custom depot names
Browse files Browse the repository at this point in the history
  • Loading branch information
LordAro authored and douiwby committed Apr 16, 2020
1 parent a85f075 commit 412bcc1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/depot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ INSTANTIATE_POOL_METHODS(Depot)
*/
Depot::~Depot()
{
free(this->name);

if (CleaningPool()) return;

if (!IsDepotTile(this->xy) || GetDepotIndex(this->xy) != this->index) {
Expand Down

0 comments on commit 412bcc1

Please sign in to comment.