Commit 9f9fec18 authored by Sven Baars's avatar Sven Baars Committed by Alexandre Julliard

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

parent 16fe2037
...@@ -1446,7 +1446,7 @@ static BOOL invert_swizzle(unsigned int *swizzle, unsigned int *writemask, unsig ...@@ -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, 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) 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; struct hlsl_type *lhs_type;
DWORD writemask = 0; DWORD writemask = 0;
...@@ -1459,6 +1459,7 @@ struct hlsl_ir_node *add_assignment(struct list *instrs, struct hlsl_ir_node *lh ...@@ -1459,6 +1459,7 @@ struct hlsl_ir_node *add_assignment(struct list *instrs, struct hlsl_ir_node *lh
return NULL; return NULL;
} }
assign = d3dcompiler_alloc(sizeof(*assign));
if (!assign) if (!assign)
{ {
ERR("Out of memory\n"); ERR("Out of memory\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment