summaryrefslogtreecommitdiff
path: root/src/newgrf.cpp
diff options
context:
space:
mode:
authorRubidium <rubidium@openttd.org>2021-05-09 22:51:26 +0200
committerrubidium42 <rubidium42@users.noreply.github.com>2021-05-10 16:03:31 +0200
commit296194ad36c601cf12d215a65d84222bbdf4de61 (patch)
tree99a0074d211257c2a5c29c40da75f23713eaf406 /src/newgrf.cpp
parent79fc094c54801bba83dc8aca2028fd6baf35965f (diff)
downloadopenttd-296194ad36c601cf12d215a65d84222bbdf4de61.tar.xz
Fix: memory leak due to assigning result of strdup to a std::string
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r--src/newgrf.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 7b8ab9de1..c372f033a 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -7394,7 +7394,7 @@ static void GRFInhibit(ByteReader *buf)
if (file != nullptr && file != _cur.grfconfig) {
grfmsg(2, "GRFInhibit: Deactivating file '%s'", file->filename);
GRFError *error = DisableGrf(STR_NEWGRF_ERROR_FORCEFULLY_DISABLED, file);
- error->data = stredup(_cur.grfconfig->GetName());
+ error->data = _cur.grfconfig->GetName();
}
}
}