mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-04 05:15:21 +00:00
(svn r13814) -Fix (r13810): MSVC (as usual) does stupid things. This time it is copying around a struct it created itself, causing bad things to happen if you don't explicitly set all variables to something remotely sane in the constructor.
This commit is contained in:
parent
81c50c6c32
commit
9bee994898
@ -12,6 +12,10 @@
|
|||||||
struct TarListEntry {
|
struct TarListEntry {
|
||||||
const char *filename;
|
const char *filename;
|
||||||
|
|
||||||
|
/* MSVC goes copying around this struct after initialisation, so it tries
|
||||||
|
* to free filename, which isn't set at that moment... but because it
|
||||||
|
* initializes the variable with garbage, it's going to segfault. */
|
||||||
|
TarListEntry() : filename(NULL) {}
|
||||||
~TarListEntry() { free((void*)this->filename); }
|
~TarListEntry() { free((void*)this->filename); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user