aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2011-02-28 18:31:36 +0000
committerMichael Snyder <msnyder@vmware.com>2011-02-28 18:31:36 +0000
commitc05202a107c40a2e1efb1739b7dc2cfaf3b0ed9b (patch)
treef6f81fa45cbb733ea3fade8dbefb3176b9baa5d0
parent007d618909cb8e7f1c51f296a52f9729e85bf781 (diff)
downloadgdb-c05202a107c40a2e1efb1739b7dc2cfaf3b0ed9b.zip
gdb-c05202a107c40a2e1efb1739b7dc2cfaf3b0ed9b.tar.gz
gdb-c05202a107c40a2e1efb1739b7dc2cfaf3b0ed9b.tar.bz2
2011-02-28 Michael Snyder <msnyder@vmware.com>
* opencl-lang.c (lval_func_free_closure): Fix use-after-free.
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/opencl-lang.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b2c0f47..d8afa4b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2011-02-28 Michael Snyder <msnyder@vmware.com>
+
+ * opencl-lang.c (lval_func_free_closure): Fix use-after-free.
+
2011-02-28 Tom Tromey <tromey@redhat.com>
* psymtab.c (expand_partial_symbol_tables): Use
diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c
index e13bac3..1004f08 100644
--- a/gdb/opencl-lang.c
+++ b/gdb/opencl-lang.c
@@ -348,9 +348,9 @@ lval_func_free_closure (struct value *v)
if (c->refc == 0)
{
+ value_free (c->val); /* Decrement the reference counter of the value. */
xfree (c->indices);
xfree (c);
- value_free (c->val); /* Decrement the reference counter of the value. */
}
}