diff options
author | smatz <smatz@openttd.org> | 2008-12-24 21:25:09 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-12-24 21:25:09 +0000 |
commit | 921863da15b912dc07b838530fefaaa01a3599ae (patch) | |
tree | 60f715337d43520308a8a5088c9da8a6c7390cd6 | |
parent | 4ec06cc478532e927ffa91a2298fc713608e8183 (diff) | |
download | openttd-921863da15b912dc07b838530fefaaa01a3599ae.tar.xz |
(svn r14737) -Fix (r10211): memory leak in Action 0x0F (new town names)
-rw-r--r-- | src/newgrf.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp index f44b993cd..e99915b57 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -4796,7 +4796,10 @@ static void FeatureTownName(byte *buf, size_t len) if (!check_length(len, 1, "FeatureTownName: style name")) return; const char *name = grf_load_string(&buf, len); len -= strlen(name) + 1; - grfmsg(6, "FeatureTownName: lang 0x%X -> '%s'", lang, TranslateTTDPatchCodes(grfid, name)); + + char *lang_name = TranslateTTDPatchCodes(grfid, name); + grfmsg(6, "FeatureTownName: lang 0x%X -> '%s'", lang, lang_name); + free(lang_name); townname->name[nb_gen] = AddGRFString(grfid, id, lang, new_scheme, name, STR_UNDEFINED); |