This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA] main,c, captured_main, close memory leak (python)
- From: Michael Snyder <msnyder at vmware dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, Doug Evans <dje at google dot com>
- Date: Sun, 06 Mar 2011 14:33:52 -0800
- Subject: [RFA] main,c, captured_main, close memory leak (python)
OK Doug?
2011-03-06 Michael Snyder <msnyder@vmware.com>
* main.c (captured_main): Fix memory leak.
Index: main.c
===================================================================
RCS file: /cvs/src/src/gdb/main.c,v
retrieving revision 1.92
diff -u -p -r1.92 main.c
--- main.c 9 Jan 2011 03:20:33 -0000 1.92
+++ main.c 6 Mar 2011 22:31:09 -0000
@@ -352,11 +352,14 @@ captured_main (void *data)
GDB_DATADIR_RELOCATABLE);
#ifdef WITH_PYTHON_PATH
- /* For later use in helping Python find itself. */
- python_libdir = relocate_directory (argv[0],
- concat (WITH_PYTHON_PATH,
- SLASH_STRING, "lib", NULL),
- PYTHON_PATH_RELOCATABLE);
+ {
+ /* For later use in helping Python find itself. */
+ char *tmp = concat (WITH_PYTHON_PATH, SLASH_STRING, "lib", NULL);
+
+ python_libdir = relocate_directory (argv[0], tmp,
+ PYTHON_PATH_RELOCATABLE);
+ xfree (tmp);
+ }
#endif
#ifdef RELOC_SRCDIR