mirror of
https://github.com/reactos/reactos.git
synced 2024-06-30 18:01:07 +00:00
[RAPPS]
fix handle leaks svn path=/trunk/; revision=67305
This commit is contained in:
parent
ece1ba5016
commit
3804a6e321
|
@ -26,7 +26,7 @@
|
|||
b[0] = '\0';
|
||||
|
||||
LIST_ENTRY CachedEntriesHead = { &CachedEntriesHead, &CachedEntriesHead };
|
||||
PLIST_ENTRY pCachedEntry = NULL;
|
||||
PLIST_ENTRY pCachedEntry = &CachedEntriesHead;
|
||||
|
||||
BOOL
|
||||
ShowAvailableAppInfo(INT Index)
|
||||
|
@ -151,13 +151,6 @@ EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc)
|
|||
PAPPLICATION_INFO Info;
|
||||
HRESULT hr;
|
||||
|
||||
/* initialize the cached list if hasn't been yet */
|
||||
if (pCachedEntry == NULL)
|
||||
{
|
||||
InitializeListHead(&CachedEntriesHead);
|
||||
pCachedEntry = &CachedEntriesHead;
|
||||
}
|
||||
|
||||
if (!GetStorageDirectory(szPath, _countof(szPath)))
|
||||
return FALSE;
|
||||
|
||||
|
|
|
@ -282,7 +282,19 @@ EnumInstalledApplications(INT EnumType, BOOL IsUserKey, APPENUMPROC lpEnumProc)
|
|||
if (!lpEnumProc(ItemIndex, pszDisplayName, &Info))
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
RegCloseKey(Info.hSubKey);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
RegCloseKey(Info.hSubKey);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
RegCloseKey(Info.hSubKey);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -127,10 +127,17 @@ EnumInstalledAppProc(INT ItemIndex, LPWSTR lpName, PINSTALLED_INFO Info)
|
|||
INT Index;
|
||||
|
||||
if (!SearchPatternMatch(lpName, szSearchPattern))
|
||||
{
|
||||
RegCloseKey(Info->hSubKey);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
ItemInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(INSTALLED_INFO));
|
||||
if (!ItemInfo) return FALSE;
|
||||
if (!ItemInfo)
|
||||
{
|
||||
RegCloseKey(Info->hSubKey);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
RtlCopyMemory(ItemInfo, Info, sizeof(INSTALLED_INFO));
|
||||
|
||||
|
|
Loading…
Reference in a new issue