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]

Fix varobj_update memleak


I suppose I wrote two much C++ code, where destructors just work.
OK?

- Volodya

	Fix memory leak.
	* varobj.c (varobj_update): Free temporary vectors.
--- gdb/varobj.c	(/mirrors/gdb_mainline)	(revision 3134)
+++ gdb/varobj.c	(/patches/gdb/varobj_update_memleak/gdb_mainline)	(revision 3134)
@@ -1143,6 +1143,9 @@ varobj_update (struct varobj **varp, str
     }
   *cv = 0;
 
+  VEC_free (varobj_p, stack);
+  VEC_free (varobj_p, result);
+
   if (type_changed)
     return -2;
   else

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