mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-shader: Cleanup predefined macro body on allocation failure.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
f26eed586d
commit
1e01656def
@ -743,10 +743,14 @@ int preproc_lexer_parse(const struct vkd3d_shader_compile_info *compile_info,
|
||||
vkd3d_string_buffer_init(&body);
|
||||
vkd3d_string_buffer_printf(&body, "%s", ctx.preprocess_info->macros[i].value);
|
||||
if (!(name = vkd3d_strdup(ctx.preprocess_info->macros[i].name)))
|
||||
{
|
||||
vkd3d_string_buffer_cleanup(&body);
|
||||
goto fail;
|
||||
}
|
||||
if (!preproc_add_macro(&ctx, &loc, name, NULL, 0, &loc, &body))
|
||||
{
|
||||
vkd3d_free(name);
|
||||
vkd3d_string_buffer_cleanup(&body);
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user