glsl: initialise pointer to NULL
authorJakob Sinclair <sinclair.jakob@openmailbox.org>
Fri, 3 Jun 2016 23:09:52 +0000 (01:09 +0200)
committerIago Toral Quiroga <itoral@igalia.com>
Tue, 7 Jun 2016 06:13:25 +0000 (08:13 +0200)
Could cause issues if you tried to read from an uninitialised pointer.
This just initalises the pointer to null to avoid that being a problem.
Discovered by Coverity.

CID: 1343616

Signed-off-by: Jakob Sinclair <sinclair.jakob@openmailbox.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/compiler/glsl/glsl_parser_extras.cpp

index fde8c193597453ba6943b9c85e155965c8353279..09f7477265958ee1bb7c70b84bed6a96c2ad5626 100644 (file)
@@ -1603,6 +1603,7 @@ ast_struct_specifier::ast_struct_specifier(const char *identifier,
    name = identifier;
    this->declarations.push_degenerate_list_at_head(&declarator_list->link);
    is_declaration = true;
+   layout = NULL;
 }
 
 void ast_subroutine_list::print(void) const