summaryrefslogtreecommitdiff
path: root/gdb/main.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@specifix.com>2011-03-07 18:34:30 +0000
committerMichael Snyder <msnyder@specifix.com>2011-03-07 18:34:30 +0000
commite519d312866adab5a38c2ddf6cd6c19a9c8e9025 (patch)
treee426d1c77c67bd4d32ef6ac8d5b1873b629418e1 /gdb/main.c
parent86eea50bade7cf59f53b9b9b44c928962e8c3c33 (diff)
downloadgdb-e519d312866adab5a38c2ddf6cd6c19a9c8e9025.tar.gz
2011-03-06 Michael Snyder <msnyder@vmware.com>
* main.c (captured_main): Fix memory leak.
Diffstat (limited to 'gdb/main.c')
-rw-r--r--gdb/main.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gdb/main.c b/gdb/main.c
index 6be4805b567..ff305a1f69d 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -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