Fix memory leak when passing directories to -file

This commit is contained in:
Randy Heit 2015-04-03 21:50:08 -05:00
parent efa82cf38b
commit fc6f983c13

View file

@ -111,9 +111,12 @@ FDirectory::FDirectory(const char * directory)
#ifdef _WIN32
directory = _fullpath(NULL, directory, _MAX_PATH);
#else
// Todo for Linux: Resolve the path befire using it
// Todo for Linux: Resolve the path before using it
#endif
dirname = directory;
#ifdef _WIN32
free((void *)directory);
#endif
dirname.ReplaceChars('\\', '/');
if (dirname[dirname.Len()-1] != '/') dirname += '/';
Filename = copystring(dirname);