This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Fix varobj_update memleak
- From: Vladimir Prus <ghost at cs dot msu dot su>
- To: gdb-patches at sources dot redhat dot com
- Date: Tue, 9 Jan 2007 23:43:11 +0300
- Subject: 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