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
@@ -7563,7 +7563,7 @@ static void GRFInhibit(ByteReader *buf)
|
||||
if (file != nullptr && file != _cur.grfconfig) {
|
||||
grfmsg(2, "GRFInhibit: Deactivating file '%s'", file->GetDisplayPath());
|
||||
GRFError *error = DisableGrf(STR_NEWGRF_ERROR_FORCEFULLY_DISABLED, file);
|
||||
error->data = stredup(_cur.grfconfig->GetName());
|
||||
error->data = _cur.grfconfig->GetName();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user