From b8043d27217ff89abba733476cb71c3656f5722a Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 11 Aug 2022 13:16:46 -0600 Subject: 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. --- gdb/main.c | 1 + 1 file changed, 1 insertion(+) (limited to 'gdb/main.c') 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; -- cgit v1.1