Changeset - r9703:dd910442ef0b
[Not reviewed]
master
0 1 0
rubidium - 16 years ago 2008-07-24 08:46:34
rubidium@openttd.org
(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.
1 file changed with 4 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/tar_type.h
Show inline comments
 
@@ -12,6 +12,10 @@
 
struct TarListEntry {
 
	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); }
 
};
 

	
0 comments (0 inline, 0 general)