vkd3d-shader/hlsl: Properly free new store node memory if init_deref() fails.

This commit is contained in:
Francisco Casas 2022-09-14 16:57:13 -03:00 committed by Alexandre Julliard
parent 3857ca06fa
commit 6f6ba8aa56
Notes: Alexandre Julliard 2022-11-10 22:56:31 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Zebediah Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/42

View File

@ -885,7 +885,10 @@ struct hlsl_ir_store *hlsl_new_store_index(struct hlsl_ctx *ctx, const struct hl
init_node(&store->node, HLSL_IR_STORE, NULL, loc);
if (!init_deref(ctx, &store->lhs, lhs->var, lhs->path_len + !!idx))
{
vkd3d_free(store);
return NULL;
}
for (i = 0; i < lhs->path_len; ++i)
hlsl_src_from_node(&store->lhs.path[i], lhs->path[i].node);
if (idx)