From: Carl Worth Date: Tue, 3 Aug 2010 00:27:56 +0000 (-0700) Subject: glsl2: Use talloc_zero_size instead of talloc_size to allocate ast_node objects. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1575070bfeedbc7decb7e44ac81abaeec0497a07;p=mesa.git glsl2: Use talloc_zero_size instead of talloc_size to allocate ast_node objects. This is a zero-ing function, (like calloc), to avoid bugs due to accessing uninitialized values. Thanks to valgrind for noticing the use of uninitialized values. --- diff --git a/src/glsl/ast.h b/src/glsl/ast.h index 1de285bb461..7ce879bb79d 100644 --- a/src/glsl/ast.h +++ b/src/glsl/ast.h @@ -42,7 +42,7 @@ public: { void *node; - node = talloc_size(ctx, size); + node = talloc_zero_size(ctx, size); assert(node != NULL); return node;