Author: cwittich
Date: Thu Sep 3 17:35:37 2015
New Revision: 68960
URL:
http://svn.reactos.org/svn/reactos?rev=68960&view=rev
Log:
[RECYCLEBIN] fix some resource leaks CID 716559 716560
Modified:
trunk/reactos/lib/recyclebin/recyclebin_v5.c
Modified: trunk/reactos/lib/recyclebin/recyclebin_v5.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/recyclebin/recyclebin_…
==============================================================================
--- trunk/reactos/lib/recyclebin/recyclebin_v5.c [iso-8859-1] (original)
+++ trunk/reactos/lib/recyclebin/recyclebin_v5.c [iso-8859-1] Thu Sep 3 17:35:37 2015
@@ -222,7 +222,10 @@
/* Check if file exists */
dwAttributes = GetFileAttributesW(szFullName);
if (dwAttributes == INVALID_FILE_ATTRIBUTES)
+ {
+ CoTaskMemFree(szFullName);
return HRESULT_FROM_WIN32(GetLastError());
+ }
if (dwBufferLength < 2 || szFullName[1] != ':')
{
@@ -261,8 +264,8 @@
FileSize.u.LowPart = GetFileSize(s->hInfo, &FileSize.u.HighPart);
if (FileSize.u.LowPart < sizeof(INFO2_HEADER))
{
- UnmapViewOfFile(pHeader);
- return HRESULT_FROM_WIN32(GetLastError());
+ hr = HRESULT_FROM_WIN32(GetLastError());
+ goto cleanup;
}
dwEntries = (DWORD)((FileSize.QuadPart - sizeof(INFO2_HEADER)) /
sizeof(DELETED_FILE_RECORD)) - 1;
pDeletedFile = ((PDELETED_FILE_RECORD)(pHeader + 1)) + dwEntries;