This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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.  */
     }
 }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]