summaryrefslogtreecommitdiff
path: root/ir.cpp
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2010-06-23 18:25:04 -0700
committerCarl Worth <cworth@cworth.org>2010-06-23 19:00:42 -0700
commite01193af325cbdde51b3219c85c58f19d5a87f1b (patch)
tree8d73fe130ac1b21361f260feb13e0beeae6348ae /ir.cpp
parent522de3f5ecbfe3f84e92ac03d1438a44eb1beae7 (diff)
Close memory leak in ir_call::get_error_instruction.
By propagating a 'ctx' parameter through these calls. This fix happens to have no impact on glsl-orangebook-ch06-bump.frag, (since it doesn't trigger any errors).
Diffstat (limited to 'ir.cpp')
-rw-r--r--ir.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/ir.cpp b/ir.cpp
index 26cd475552..6286d874e6 100644
--- a/ir.cpp
+++ b/ir.cpp
@@ -833,10 +833,8 @@ ir_function::ir_function(const char *name)
ir_call *
-ir_call::get_error_instruction()
+ir_call::get_error_instruction(void *ctx)
{
- /* NULL is wrong and leaks */
- void *ctx = NULL;
ir_call *call = new(ctx) ir_call;
call->type = glsl_type::error_type;