Author: tfaber
Date: Fri Jan 17 16:07:32 2014
New Revision: 61652
URL:
http://svn.reactos.org/svn/reactos?rev=61652&view=rev
Log:
[CABMAN]
- Fix a memory leak
Modified:
trunk/reactos/tools/cabman/cabinet.cxx
Modified: trunk/reactos/tools/cabman/cabinet.cxx
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/cabman/cabinet.cxx?r…
==============================================================================
--- trunk/reactos/tools/cabman/cabinet.cxx [iso-8859-1] (original)
+++ trunk/reactos/tools/cabman/cabinet.cxx [iso-8859-1] Fri Jan 17 16:07:32 2014
@@ -634,22 +634,26 @@
{
FILEHANDLE FileHandle;
ULONG BytesRead;
-
-#if defined(_WIN32)
- FileHandle = CreateFile(ConvertPath(FileName, true), // Open this file
+ char* ConvertedFileName;
+
+ ConvertedFileName = ConvertPath(FileName, true);
+#if defined(_WIN32)
+ FileHandle = CreateFile(ConvertedFileName, // Open this file
GENERIC_READ, // Open for reading
FILE_SHARE_READ, // Share for reading
NULL, // No security
OPEN_EXISTING, // Existing file only
FILE_ATTRIBUTE_NORMAL, // Normal file
NULL); // No attribute template
+ free(ConvertedFileName);
if (FileHandle == INVALID_HANDLE_VALUE)
{
DPRINT(MID_TRACE, ("Cannot open cabinet reserved file.\n"));
return false;
}
#else /* !_WIN32 */
- FileHandle = fopen(ConvertPath(FileName, true), "rb");
+ FileHandle = fopen(ConvertedFileName, "rb");
+ free(ConvertedFileName);
if (FileHandle == NULL)
{
DPRINT(MID_TRACE, ("Cannot open cabinet reserved file.\n"));