diff options
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/opencl-lang.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b2c0f47702b..d8afa4b477b 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 e13bac3978a..1004f083a3d 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. */ } } |