Author: cwittich
Date: Thu Aug 2 02:50:58 2007
New Revision: 28085
URL:
http://svn.reactos.org/svn/reactos?rev=28085&view=rev
Log:
fix a memory leak
Modified:
trunk/reactos/base/shell/cmd/misc.c
trunk/reactos/base/shell/cmd/type.c
Modified: trunk/reactos/base/shell/cmd/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/misc.c?rev=…
==============================================================================
--- trunk/reactos/base/shell/cmd/misc.c (original)
+++ trunk/reactos/base/shell/cmd/misc.c Thu Aug 2 02:50:58 2007
@@ -473,7 +473,12 @@
}
if (!dwRead && !len)
+ {
+#ifdef _UNICODE
+ cmd_free(lpString);
+#endif
return FALSE;
+ }
lpString[len++] = _T('\0');
#ifdef _UNICODE
Modified: trunk/reactos/base/shell/cmd/type.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/type.c?rev=…
==============================================================================
--- trunk/reactos/base/shell/cmd/type.c (original)
+++ trunk/reactos/base/shell/cmd/type.c Thu Aug 2 02:50:58 2007
@@ -97,13 +97,13 @@
NULL);
ConErrPrintf (_T("%s - %s"), argv[i], errmsg);
LocalFree (errmsg);
- nErrorLevel = 1;
+ nErrorLevel = 1;
continue;
}
do
{
- bRet = FileGetString (hFile, buff, sizeof(buff) /
sizeof(TCHAR));
+ bRet = FileGetString (hFile, buff, sizeof(buff) / sizeof(TCHAR));
if(bPaging)
{
if(bRet)