aboutsummaryrefslogtreecommitdiff
path: root/gdb/main.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-08-11 13:16:46 -0600
committerTom Tromey <tromey@adacore.com>2022-08-31 11:03:40 -0600
commitb8043d27217ff89abba733476cb71c3656f5722a (patch)
treea7efa23160073f021426d105a703536b3205b4aa /gdb/main.c
parent4311c583a6ac84e880207bf0418872f407557e60 (diff)
downloadfsf-binutils-gdb-b8043d27217ff89abba733476cb71c3656f5722a.zip
fsf-binutils-gdb-b8043d27217ff89abba733476cb71c3656f5722a.tar.gz
fsf-binutils-gdb-b8043d27217ff89abba733476cb71c3656f5722a.tar.bz2
Remove a ui-related memory leak
gdb_setup_readline makes new streams and assigns to the various stream members of struct ui. However, these assignments cause the previous values to leak. As far as I can, this code is simply unnecessary and can be removed -- with the exception of the assignment to gdb_stdtarg, which is not initialized anywhere else.
Diffstat (limited to 'gdb/main.c')
-rw-r--r--gdb/main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gdb/main.c b/gdb/main.c
index 91fa196..8d2666e 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -676,6 +676,7 @@ captured_main_1 (struct captured_main_args *context)
main_ui = new ui (stdin, stdout, stderr);
current_ui = main_ui;
+ gdb_stdtarg = gdb_stderr;
gdb_stdtargerr = gdb_stderr;
gdb_stdtargin = gdb_stdin;