mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-14 20:15:39 +00:00
shell32: Reorder code to avoid memory leaks (coverity).
This commit is contained in:
parent
81c0e1eaa1
commit
b4b396a957
|
@ -369,11 +369,11 @@ static HTREEITEM InsertTreeViewItem( browse_info *info, IShellFolder * lpsf,
|
|||
tvi.cChildren= pEnumIL ? 1 : 0;
|
||||
tvi.mask |= TVIF_CHILDREN;
|
||||
|
||||
lptvid = SHAlloc( sizeof(TV_ITEMDATA) );
|
||||
if (!lptvid)
|
||||
if (!GetName(lpsf, pidl, SHGDN_NORMAL, szBuff))
|
||||
return NULL;
|
||||
|
||||
if (!GetName(lpsf, pidl, SHGDN_NORMAL, szBuff))
|
||||
lptvid = SHAlloc( sizeof(TV_ITEMDATA) );
|
||||
if (!lptvid)
|
||||
return NULL;
|
||||
|
||||
tvi.pszText = szBuff;
|
||||
|
|
|
@ -2503,10 +2503,11 @@ LPITEMIDLIST* _ILCopyaPidl(const LPCITEMIDLIST * apidlsrc, UINT cidl)
|
|||
UINT i;
|
||||
LPITEMIDLIST *apidldest;
|
||||
|
||||
apidldest = SHAlloc(cidl * sizeof(LPITEMIDLIST));
|
||||
if (!apidlsrc)
|
||||
return NULL;
|
||||
|
||||
apidldest = SHAlloc(cidl * sizeof(LPITEMIDLIST));
|
||||
|
||||
for (i = 0; i < cidl; i++)
|
||||
apidldest[i] = ILClone(apidlsrc[i]);
|
||||
|
||||
|
|
|
@ -1061,7 +1061,7 @@ static HRESULT WINAPI ShellDispatch_IsServiceRunning(IShellDispatch2 *iface, BST
|
|||
if (!service)
|
||||
{
|
||||
ERR("Failed to open service %s (%u)\n", debugstr_w(name), GetLastError());
|
||||
CloseServiceHandle(service);
|
||||
CloseServiceHandle(scm);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -3790,7 +3790,10 @@ static BOOL is_knownfolder( struct foldermanager *fm, const KNOWNFOLDERID *id )
|
|||
|
||||
hr = get_known_folder_registry_path(id, NULL, ®istryPath);
|
||||
if(SUCCEEDED(hr))
|
||||
{
|
||||
hr = HRESULT_FROM_WIN32(RegOpenKeyExW(HKEY_LOCAL_MACHINE, registryPath, 0, 0, &hKey));
|
||||
HeapFree(GetProcessHeap(), 0, registryPath);
|
||||
}
|
||||
|
||||
if(SUCCEEDED(hr))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue