Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- libs/vkd3d-shader/vkd3d_shader_main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c index a5931384..60020141 100644 --- a/libs/vkd3d-shader/vkd3d_shader_main.c +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -838,14 +838,16 @@ static int scan_dxbc(const struct vkd3d_shader_compile_info *compile_info, 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; @@ -889,9 +891,6 @@ int vkd3d_shader_scan(const struct vkd3d_shader_compile_info *compile_info, char
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); }