shell32: Initialize memory to zero in IShellItemArray constructor.

Nikolay Sivov bunglehead at gmail.com
Thu Jul 29 14:16:06 CDT 2010


  On 7/29/2010 22:21, David Hedberg wrote:
> This is needed as we might, if passed an invalid riid,
> hit ::Release before we get to initialize array or item_count.
> ---
>   dlls/shell32/shellitem.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/dlls/shell32/shellitem.c b/dlls/shell32/shellitem.c
> index 5b01262..a7b2f29 100644
> --- a/dlls/shell32/shellitem.c
> +++ b/dlls/shell32/shellitem.c
> @@ -765,7 +765,7 @@ static HRESULT WINAPI IShellItemArray_Constructor(IUnknown *pUnkOuter, REFIID ri
>       if(pUnkOuter)
>           return CLASS_E_NOAGGREGATION;
>
> -    This = HeapAlloc(GetProcessHeap(), 0, sizeof(IShellItemArrayImpl));
> +    This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IShellItemArrayImpl));
>       if(!This)
>           return E_OUTOFMEMORY;
>
I don't see a reason for this. If you want to zero two remaining fields 
do it explicitly. Also this helper doesn't need WINAPI it seems.



More information about the wine-devel mailing list