From 5ab1ef1cade91db400bcc1db1acc09990f3696ca Mon Sep 17 00:00:00 2001 From: Francisco Casas Date: Thu, 4 Apr 2024 18:22:41 -0300 Subject: [PATCH] vkd3d-shader/hlsl: Properly release string buffer on write_atan_or_atan2(). vkd3d_string_buffer_cleanup() doesn't do the same as hlsl_release_string_buffer(). The former only frees the char array inside the string buffer and not the string buffer itself. --- libs/vkd3d-shader/hlsl.y | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 7655f69e..3959ff84 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -2836,20 +2836,20 @@ static bool write_atan_or_atan2(struct hlsl_ctx *ctx, type->name, type->name, type->name); if (ret < 0) { - vkd3d_string_buffer_cleanup(buf); + hlsl_release_string_buffer(ctx, buf); return false; } ret = vkd3d_string_buffer_printf(buf, body_template, type->name); if (ret < 0) { - vkd3d_string_buffer_cleanup(buf); + hlsl_release_string_buffer(ctx, buf); return false; } func = hlsl_compile_internal_function(ctx, atan2_mode ? atan2_name : atan_name, buf->buffer); - vkd3d_string_buffer_cleanup(buf); + hlsl_release_string_buffer(ctx, buf); if (!func) return false;