windows.gaming.input: Fix a leak on error path (Coverity).

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
Nikolay Sivov 2022-06-05 10:03:47 +03:00 committed by Alexandre Julliard
parent 631f4d5e42
commit ea4c506cd7

View file

@ -335,6 +335,7 @@ static HRESULT async_info_create( IUnknown *invoker, IUnknown *param, async_oper
IInspectable *outer, IWineAsyncInfoImpl **out )
{
struct async_info *impl;
HRESULT hr;
if (!(impl = calloc( 1, sizeof(struct async_info) ))) return E_OUTOFMEMORY;
impl->IWineAsyncInfoImpl_iface.lpVtbl = &async_impl_vtbl;
@ -346,7 +347,11 @@ static HRESULT async_info_create( IUnknown *invoker, IUnknown *param, async_oper
impl->handler = HANDLER_NOT_SET;
impl->status = Started;
if (!(impl->async_run_work = CreateThreadpoolWork( async_info_callback, &impl->IWineAsyncInfoImpl_iface, NULL )))
return HRESULT_FROM_WIN32( GetLastError() );
{
hr = HRESULT_FROM_WIN32( GetLastError() );
free( impl );
return hr;
}
if ((impl->invoker = invoker)) IUnknown_AddRef( impl->invoker );
if ((impl->param = param)) IUnknown_AddRef( impl->param );