mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-28 15:18:37 +08:00
Remove NULL checks before xfree
A couple of spots in the TUI did a NULL check before an xfree. This isn't necessary, and most other cases were removed from gdb a while ago. gdb/ChangeLog 2019-06-25 Tom Tromey <tom@tromey.com> * tui/tui-source.c (tui_set_source_content): Don't check before xfree. * tui/tui-disasm.c (tui_disassemble): Don't check before xfree.
This commit is contained in:
@ -1,3 +1,9 @@
|
||||
2019-06-25 Tom Tromey <tom@tromey.com>
|
||||
|
||||
* tui/tui-source.c (tui_set_source_content): Don't check before
|
||||
xfree.
|
||||
* tui/tui-disasm.c (tui_disassemble): Don't check before xfree.
|
||||
|
||||
2019-06-25 Tom Tromey <tom@tromey.com>
|
||||
|
||||
* tui/tui-winsource.h (tui_update_source_window_as_is)
|
||||
|
@ -59,9 +59,7 @@ tui_disassemble (struct gdbarch *gdbarch, struct tui_asm_line *asm_lines,
|
||||
/* Now construct each line. */
|
||||
for (; count > 0; count--, asm_lines++)
|
||||
{
|
||||
if (asm_lines->addr_string)
|
||||
xfree (asm_lines->addr_string);
|
||||
if (asm_lines->insn)
|
||||
xfree (asm_lines->insn);
|
||||
|
||||
print_address (gdbarch, pc, &gdb_dis_out);
|
||||
|
@ -163,7 +163,6 @@ tui_set_source_content (struct symtab *s,
|
||||
= (struct tui_source_window_base *) TUI_SRC_WIN;
|
||||
const char *s_filename = symtab_to_filename_for_display (s);
|
||||
|
||||
if (TUI_SRC_WIN->title)
|
||||
xfree (TUI_SRC_WIN->title);
|
||||
TUI_SRC_WIN->title = xstrdup (s_filename);
|
||||
|
||||
|
Reference in New Issue
Block a user