Author: jgardou
Date: Thu Oct 25 00:10:20 2012
New Revision: 57613
URL:
http://svn.reactos.org/svn/reactos?rev=57613&view=rev
Log:
[SHELL32]
- remove invalid pointer from list in case of failure to add the icon to the image list
Modified:
trunk/reactos/dll/win32/shell32/iconcache.cpp
Modified: trunk/reactos/dll/win32/shell32/iconcache.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/iconcach…
==============================================================================
--- trunk/reactos/dll/win32/shell32/iconcache.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/iconcache.cpp [iso-8859-1] Thu Oct 25 00:10:20 2012
@@ -323,7 +323,7 @@
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 @@
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 @@
leave:
if(ret == INVALID_INDEX)
{
+ if(indexDPA != -1) DPA_DeletePtr(sic_hdpa, indexDPA);
HeapFree(GetProcessHeap(), 0, lpsice->sSourceFile);
SHFree(lpsice);
}