shell32: check result of HeapAlloc()

James Hawkins truiken at gmail.com
Sat May 12 19:46:53 CDT 2007


On 5/12/07, hto at mail.cnt.ru <hto at mail.cnt.ru> wrote:
>
> --- wine-0.9.37-orig/dlls/shell32/folders.c     2007-05-12 22:53:06.000000000 +0000
> +++ wine-0.9.37/dlls/shell32/folders.c  2007-05-13 00:17:00.000000000 +0000
> @@ -81,11 +81,15 @@ IExtractIconW* IExtractIconW_Constructor
>         TRACE("%p\n", pidl);
>
>         ei = HeapAlloc(GetProcessHeap(),0,sizeof(IExtractIconWImpl));
> -       ei->ref=1;
> -       ei->lpVtbl = &eivt;
> -       ei->lpvtblPersistFile = &pfvt;
> -       ei->lpvtblExtractIconA = &eiavt;
> -       ei->pidl=ILClone(pidl);
> +
> +       if (ei)
> +       {
> +         ei->ref=1;
> +         ei->lpVtbl = &eivt;
> +         ei->lpvtblPersistFile = &pfvt;
> +         ei->lpvtblExtractIconA = &eiavt;
> +         ei->pidl=ILClone(pidl);
> +       }
>

If a HeapAlloc call fails, you need to return with the appropriate error.

-- 
James Hawkins



More information about the wine-devel mailing list