vkd3d-shader: Do not check for NULL in vkd3d_shader_free_scan_descriptor_info().

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 2020-08-25 10:22:28 -05:00 committed by Alexandre Julliard
parent 9a0692978e
commit 6c10b52804
1 changed files with 4 additions and 5 deletions

View File

@ -884,14 +884,16 @@ int vkd3d_shader_scan(const struct vkd3d_shader_compile_info *compile_info, char
if (instruction.handler_idx == VKD3DSIH_INVALID)
{
WARN("Encountered unrecognized or invalid instruction.\n");
vkd3d_shader_free_scan_descriptor_info(scan_descriptor_info);
if (scan_descriptor_info)
vkd3d_shader_free_scan_descriptor_info(scan_descriptor_info);
ret = VKD3D_ERROR_INVALID_SHADER;
goto done;
}
if ((ret = vkd3d_shader_scan_instruction(&context, &instruction)) < 0)
{
vkd3d_shader_free_scan_descriptor_info(scan_descriptor_info);
if (scan_descriptor_info)
vkd3d_shader_free_scan_descriptor_info(scan_descriptor_info);
goto done;
}
++message_context->line;
@ -910,9 +912,6 @@ done:
void vkd3d_shader_free_scan_descriptor_info(struct vkd3d_shader_scan_descriptor_info *scan_descriptor_info)
{
if (!scan_descriptor_info)
return;
vkd3d_free(scan_descriptor_info->descriptors);
}