From fc6f983c136ec01aa4759bd9eb896c310222d74f Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Fri, 3 Apr 2015 21:50:08 -0500 Subject: [PATCH] Fix memory leak when passing directories to -file --- src/resourcefiles/file_directory.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/resourcefiles/file_directory.cpp b/src/resourcefiles/file_directory.cpp index 08cb99ea99..f6adf07239 100644 --- a/src/resourcefiles/file_directory.cpp +++ b/src/resourcefiles/file_directory.cpp @@ -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);