Mesa (master): glsl2: Fix copy'n' paste hilarity leading to leaking in the refcount visitor.

Eric Anholt anholt at kemper.freedesktop.org
Wed Aug 18 21:20:37 UTC 2010


Module: Mesa
Branch: master
Commit: 0b09e6410f1173c2f69b601e43c5b14d8ad97345
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0b09e6410f1173c2f69b601e43c5b14d8ad97345

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Aug 18 11:42:42 2010 -0700

glsl2: Fix copy'n'paste hilarity leading to leaking in the refcount visitor.

---

 src/glsl/ir_dead_code.cpp       |    1 -
 src/glsl/ir_variable_refcount.h |    2 +-
 2 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/glsl/ir_dead_code.cpp b/src/glsl/ir_dead_code.cpp
index fce9212..7ff580d 100644
--- a/src/glsl/ir_dead_code.cpp
+++ b/src/glsl/ir_dead_code.cpp
@@ -101,7 +101,6 @@ do_dead_code(exec_list *instructions)
 	 }
       }
    }
-   talloc_free(v.mem_ctx);
 
    return progress;
 }
diff --git a/src/glsl/ir_variable_refcount.h b/src/glsl/ir_variable_refcount.h
index 30dd2bd..059ea09 100644
--- a/src/glsl/ir_variable_refcount.h
+++ b/src/glsl/ir_variable_refcount.h
@@ -67,7 +67,7 @@ public:
 
    ~ir_variable_refcount_visitor(void)
    {
-      this->mem_ctx = talloc_new(NULL);
+      talloc_free(this->mem_ctx);
    }
 
    virtual ir_visitor_status visit(ir_variable *);




More information about the mesa-commit mailing list