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] 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);
 

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