diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 7d73dd1eee5..04ee0454b61 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -1624,7 +1624,10 @@ HRESULT CDECL wined3d_swapchain_state_create(const struct wined3d_swapchain_desc return E_OUTOFMEMORY; if (FAILED(hr = wined3d_swapchain_state_init(s, desc, window, wined3d, adapter_idx))) + { + heap_free(s); return hr; + } *state = s;