aboutsummaryrefslogtreecommitdiff
path: root/gdb/main.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2011-03-07 18:34:31 +0000
committerMichael Snyder <msnyder@vmware.com>2011-03-07 18:34:31 +0000
commite6040cbdcd2feb312855101655e6c314f8fc3d25 (patch)
treedba1a22892e7278a3152c0b7b4603aea49c0698c /gdb/main.c
parent052874e8a4698786ff07ce9d681275318905d1af (diff)
downloadgdb-e6040cbdcd2feb312855101655e6c314f8fc3d25.zip
gdb-e6040cbdcd2feb312855101655e6c314f8fc3d25.tar.gz
gdb-e6040cbdcd2feb312855101655e6c314f8fc3d25.tar.bz2
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 6be4805..ff305a1 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