This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[rfa] py-value.c, memory leak
- From: Michael Snyder <msnyder at vmware dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Sun, 27 Feb 2011 14:53:00 -0800
- Subject: [rfa] py-value.c, memory leak
Feel like I need review for this...
2011-02-27 Michael Snyder <msnyder@vmware.com>
* python/py-value.c (valpy_str): Fix memory leak.
Index: python/py-value.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-value.c,v
retrieving revision 1.22
diff -u -p -u -p -r1.22 py-value.c
--- python/py-value.c 26 Feb 2011 02:07:09 -0000 1.22
+++ python/py-value.c 27 Feb 2011 22:51:18 -0000
@@ -570,6 +570,7 @@ valpy_str (PyObject *self)
common_val_print (((value_object *) self)->value, stb, 0,
&opts, python_language);
s = ui_file_xstrdup (stb, NULL);
+ make_cleanup (xfree, s);
}
GDB_PY_HANDLE_EXCEPTION (except);