From 6c10b5280444d5c6219d3c557a3d6f1c994a33eb Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Tue, 25 Aug 2020 10:22:28 -0500 Subject: [PATCH] vkd3d-shader: Do not check for NULL in vkd3d_shader_free_scan_descriptor_info(). Signed-off-by: Zebediah Figura Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- 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 e0a04fc1..68e23dad 100644 --- a/libs/vkd3d-shader/vkd3d_shader_main.c +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -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); }