wined3d: Properly cleanup on failure in wined3d_cs_create().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2016-05-23 18:06:26 +02:00 committed by Alexandre Julliard
parent 698d411467
commit 10e601ba3c
1 changed files with 2 additions and 0 deletions

View File

@ -1144,6 +1144,8 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
cs->data_size = WINED3D_INITIAL_CS_SIZE;
if (!(cs->data = HeapAlloc(GetProcessHeap(), 0, cs->data_size)))
{
state_cleanup(&cs->state);
HeapFree(GetProcessHeap(), 0, cs->fb.render_targets);
HeapFree(GetProcessHeap(), 0, cs);
return NULL;
}