vkd3d-utils: Avoid leaking "messages" when vkd3d_blob_create() fails.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2022-03-06 20:04:34 -06:00 committed by Alexandre Julliard
parent d1d9e713f2
commit e9fd9a79a1

View File

@ -269,6 +269,7 @@ HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filen
{
if (FAILED(hr = vkd3d_blob_create(messages, strlen(messages), messages_blob)))
{
vkd3d_shader_free_messages(messages);
vkd3d_shader_free_shader_code(&byte_code);
return hr;
}
@ -356,6 +357,7 @@ HRESULT WINAPI D3DPreprocess(const void *data, SIZE_T size, const char *filename
{
if (FAILED(hr = vkd3d_blob_create(messages, strlen(messages), messages_blob)))
{
vkd3d_shader_free_messages(messages);
vkd3d_shader_free_shader_code(&preprocessed_code);
return hr;
}