[RFA] main,c, captured_main, close memory leak (python)
Joel Brobecker
brobecker@adacore.com
Mon Mar 7 11:30:00 GMT 2011
> OK Doug?
>
> 2011-03-06 Michael Snyder <msnyder@vmware.com>
>
> * main.c (captured_main): Fix memory leak.
FWIW, it looks correct to me. Let's wait for Doug's opinion, though.
> 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
--
Joel
More information about the Gdb-patches
mailing list