summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles Pigott <charlespigott@googlemail.com>2020-02-09 11:44:45 +0000
committerCharles Pigott <charlespigott@googlemail.com>2020-02-09 11:58:30 +0000
commite340934d04a26a8917f23f73141556e85fbae0b1 (patch)
treefa7c99d440217038c9b086be1bd225fddf70002d /src
parent2f264f2c92d202608cb54cf6f06abf8e2aa0e875 (diff)
downloadopenttd-e340934d04a26a8917f23f73141556e85fbae0b1.tar.xz
Fix #7988: Memory leak when using custom depot names
Diffstat (limited to 'src')
-rw-r--r--src/depot.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/depot.cpp b/src/depot.cpp
index 05e2af3d4..9207c6362 100644
--- a/src/depot.cpp
+++ b/src/depot.cpp
@@ -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) {