diff --git a/dlls/shell32/recyclebin.c b/dlls/shell32/recyclebin.c index 44e99fc2334..9e75c301fa9 100644 --- a/dlls/shell32/recyclebin.c +++ b/dlls/shell32/recyclebin.c @@ -410,33 +410,27 @@ static HRESULT WINAPI RecycleBin_EnumObjects(IShellFolder2 *iface, HWND hwnd, SH RecycleBin *This = impl_from_IShellFolder2(iface); IEnumIDList *list; LPITEMIDLIST *pidls; - HRESULT ret; + HRESULT ret = E_OUTOFMEMORY; int pidls_count; int i=0; TRACE("(%p, %p, %x, %p)\n", This, hwnd, grfFlags, ppenumIDList); + *ppenumIDList = NULL; + list = IEnumIDList_Constructor(); + if (!list) + return E_OUTOFMEMORY; + if (grfFlags & SHCONTF_NONFOLDERS) { - *ppenumIDList = NULL; if (FAILED(ret = TRASH_EnumItems(&pidls, &pidls_count))) - return ret; - - list = IEnumIDList_Constructor(); - if (list == NULL) goto failed; for (i=0; i