fix a memory leak

svn path=/trunk/; revision=28085
This commit is contained in:
Christoph von Wittich 2007-08-01 22:50:58 +00:00
parent 953da5af6e
commit 1ef29d0d83
2 changed files with 7 additions and 2 deletions

View file

@ -473,7 +473,12 @@ BOOL FileGetString (HANDLE hFile, LPTSTR lpBuffer, INT nBufferLength)
}
if (!dwRead && !len)
{
#ifdef _UNICODE
cmd_free(lpString);
#endif
return FALSE;
}
lpString[len++] = _T('\0');
#ifdef _UNICODE

View file

@ -97,13 +97,13 @@ INT cmd_type (LPTSTR cmd, LPTSTR param)
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)