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] python/py-breakpoint.c, fix memory leak


2011-02-27  Michael Snyder  <msnyder@vmware.com>

	* python/py-breakpoint.c (bppy_get_commands): Fix memory leak.

Index: python/py-breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-breakpoint.c,v
retrieving revision 1.14
diff -u -p -u -p -r1.14 py-breakpoint.c
--- python/py-breakpoint.c	4 Feb 2011 21:54:16 -0000	1.14
+++ python/py-breakpoint.c	27 Feb 2011 23:16:20 -0000
@@ -489,9 +489,9 @@ bppy_get_commands (PyObject *self, void 
       print_command_lines (uiout, breakpoint_commands (bp), 0);
     }
   ui_out_redirect (uiout, NULL);
-  cmdstr = ui_file_xstrdup (string_file, &length);
   GDB_PY_HANDLE_EXCEPTION (except);
 
+  cmdstr = ui_file_xstrdup (string_file, &length);
   result = PyString_Decode (cmdstr, strlen (cmdstr), host_charset (), NULL);
   do_cleanups (chain);
   xfree (cmdstr);

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