This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA] fix use-after-free in opencl-lang.c
- From: Michael Snyder <msnyder at vmware dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, "ken dot werner at de dot ibm dot com" <ken dot werner at de dot ibm dot com>
- Date: Sun, 27 Feb 2011 15:57:54 -0800
- Subject: [RFA] fix use-after-free in opencl-lang.c
2011-02-27 Michael Snyder <msnyder@vmware.com>
* opencl-lang.c (lval_func_free_closure): Fix use-after-free.
Index: opencl-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/opencl-lang.c,v
retrieving revision 1.7
diff -u -p -u -p -r1.7 opencl-lang.c
--- opencl-lang.c 21 Feb 2011 15:53:10 -0000 1.7
+++ opencl-lang.c 27 Feb 2011 23:53:15 -0000
@@ -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. */
}
}