d3dcompiler: Fix a leak on error path (Coverity).

Signed-off-by: Sven Baars <sbaars@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Sven Baars 2020-10-04 22:39:11 +02:00 committed by Alexandre Julliard
parent 16fe2037fb
commit 9f9fec1879

View file

@ -1446,7 +1446,7 @@ static BOOL invert_swizzle(unsigned int *swizzle, unsigned int *writemask, unsig
struct hlsl_ir_node *add_assignment(struct list *instrs, struct hlsl_ir_node *lhs,
enum parse_assign_op assign_op, struct hlsl_ir_node *rhs)
{
struct hlsl_ir_assignment *assign = d3dcompiler_alloc(sizeof(*assign));
struct hlsl_ir_assignment *assign;
struct hlsl_type *lhs_type;
DWORD writemask = 0;
@ -1459,6 +1459,7 @@ struct hlsl_ir_node *add_assignment(struct list *instrs, struct hlsl_ir_node *lh
return NULL;
}
assign = d3dcompiler_alloc(sizeof(*assign));
if (!assign)
{
ERR("Out of memory\n");