[PATCH] ole32: OleGetClipboard(): zero output interface pointer on error

Nikolay Sivov bunglehead at gmail.com
Wed Jan 13 05:05:57 CST 2016


On 13.01.2016 13:23, Paul Gofman wrote:
> Signed-off-by: Paul Gofman <gofmanp at gmail.com>
> ---
>  dlls/ole32/clipboard.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c
> index ca9520f..b871bbc 100644
> --- a/dlls/ole32/clipboard.c
> +++ b/dlls/ole32/clipboard.c
> @@ -2201,6 +2201,7 @@ HRESULT WINAPI OleGetClipboard(IDataObject **obj)
>      TRACE("(%p)\n", obj);
>  
>      if(!obj) return E_INVALIDARG;
> +    *obj = NULL;
>  
>      if(FAILED(hr = get_ole_clipbrd(&clipbrd))) return hr;
> 

Hi, Paul.

This is to handle a case when OLE was not initialized, right? If so, it
should be easy to add a test for it. It makes sense to zero it as a
common convention for out interface pointers, but a test won't hurt.




More information about the wine-devel mailing list