mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 08:55:19 +00:00
[SHELL32]
- remove invalid pointer from list in case of failure to add the icon to the image list svn path=/trunk/; revision=57613
This commit is contained in:
parent
bec3a1f913
commit
68f5fd309d
1 changed files with 4 additions and 3 deletions
|
@ -323,7 +323,7 @@ fail:
|
|||
static INT SIC_IconAppend (LPCWSTR sSourceFile, INT dwSourceIndex, HICON hSmallIcon, HICON hBigIcon, DWORD dwFlags)
|
||||
{
|
||||
LPSIC_ENTRY lpsice;
|
||||
INT ret, index, index1;
|
||||
INT ret, index, index1, indexDPA;
|
||||
WCHAR path[MAX_PATH];
|
||||
TRACE("%s %i %p %p\n", debugstr_w(sSourceFile), dwSourceIndex, hSmallIcon ,hBigIcon);
|
||||
|
||||
|
@ -338,8 +338,8 @@ static INT SIC_IconAppend (LPCWSTR sSourceFile, INT dwSourceIndex, HICON hSmallI
|
|||
|
||||
EnterCriticalSection(&SHELL32_SicCS);
|
||||
|
||||
index = DPA_InsertPtr(sic_hdpa, 0x7fff, lpsice);
|
||||
if ( INVALID_INDEX == index )
|
||||
indexDPA = DPA_InsertPtr(sic_hdpa, 0x7fff, lpsice);
|
||||
if ( -1 == indexDPA )
|
||||
{
|
||||
ret = INVALID_INDEX;
|
||||
goto leave;
|
||||
|
@ -370,6 +370,7 @@ static INT SIC_IconAppend (LPCWSTR sSourceFile, INT dwSourceIndex, HICON hSmallI
|
|||
leave:
|
||||
if(ret == INVALID_INDEX)
|
||||
{
|
||||
if(indexDPA != -1) DPA_DeletePtr(sic_hdpa, indexDPA);
|
||||
HeapFree(GetProcessHeap(), 0, lpsice->sSourceFile);
|
||||
SHFree(lpsice);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue