mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
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:
parent
d1d9e713f2
commit
e9fd9a79a1
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user