diff options
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r-- | src/glsl/ast_to_hir.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index 41371e75367..f20c7ead336 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -2471,8 +2471,8 @@ ast_struct_specifier::hir(exec_list *instructions, * the types to HIR. This ensures that structure definitions embedded in * other structure definitions are processed. */ - glsl_struct_field *const fields = (glsl_struct_field *) - malloc(sizeof(*fields) * decl_count); + glsl_struct_field *const fields = talloc_array(state, glsl_struct_field, + decl_count); unsigned i = 0; foreach_list_typed (ast_declarator_list, decl_list, link, |