diff options
Diffstat (limited to 'gdb/main.c')
-rw-r--r-- | gdb/main.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -545,7 +545,9 @@ captured_main_1 (struct captured_main_args *context) #endif /* Prefix warning messages with the command name. */ - warning_pre_print = xstrprintf ("%s: warning: ", gdb_program_name); + gdb::unique_xmalloc_ptr<char> tmp_warn_preprint + (xstrprintf ("%s: warning: ", gdb_program_name)); + warning_pre_print = tmp_warn_preprint.get (); if (! getcwd (gdb_dirbuf, sizeof (gdb_dirbuf))) perror_warning_with_name (_("error finding working directory")); @@ -972,7 +974,7 @@ captured_main_1 (struct captured_main_args *context) } /* Set off error and warning messages with a blank line. */ - xfree (warning_pre_print); + tmp_warn_preprint.reset (); warning_pre_print = _("\nwarning: "); /* Read and execute the system-wide gdbinit file, if it exists. |