On 04/17/2012 11:49 PM, Vinson Lee wrote:
Fix uninitialized pointer field defect reported by Coverity.

Signed-off-by: Vinson Lee<v...@freedesktop.org>
---
  src/glsl/opt_array_splitting.cpp |    1 +
  1 file changed, 1 insertion(+)

diff --git a/src/glsl/opt_array_splitting.cpp b/src/glsl/opt_array_splitting.cpp
index f11b516..99b6a22 100644
--- a/src/glsl/opt_array_splitting.cpp
+++ b/src/glsl/opt_array_splitting.cpp
@@ -223,6 +223,7 @@ public:
     ir_array_splitting_visitor(exec_list *vars)
     {
        this->variable_list = vars;
+      this->mem_ctx = NULL;
     }

     virtual ~ir_array_splitting_visitor()

Initializing it to NULL would mean that we allocate a bunch of memory that never gets freed. (Admittedly, using it as is, we'd crash horribly.)

But we never actually use it, so I just pushed a patch that deletes the field entirely. Thanks for pointing this out.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to