ole32: Fix some memory leaks

Alexandre Julliard julliard at winehq.org
Mon Oct 1 07:09:28 CDT 2007


Andrew Talbot <andrew.talbot at talbotville.com> writes:

> diff --git a/dlls/ole32/compositemoniker.c b/dlls/ole32/compositemoniker.c
> index c49e9b8..88f141e 100644
> --- a/dlls/ole32/compositemoniker.c
> +++ b/dlls/ole32/compositemoniker.c
> @@ -1817,8 +1817,10 @@ CompositeMonikerImpl_Construct(IMoniker*
>                  This->tabSize+=BLOCK_TAB_SIZE;
>                  This->tabMoniker=HeapReAlloc(GetProcessHeap(),0,This->tabMoniker,This->tabSize*sizeof(IMoniker));
>  
> -                if (This->tabMoniker==NULL)
> +                if (This->tabMoniker==NULL) {
> +                    HeapFree(GetProcessHeap(), 0, This);
>                      return E_OUTOFMEMORY;

This->tabMoniker is leaked too in that case, it would be good to fix
it while you are at it.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list