+2020-05-21 Simon Marchi <simon.marchi@efficios.com>
+
+ * coffread.c (patch_type): Remove NULL check before xfree.
+ * corefile.c (set_gnutarget): Likewise.
+ * cp-abi.c (set_cp_abi_as_auto_default): Likewise.
+ * exec.c (build_section_table): Likewise.
+ * remote.c (remote_target::pass_signals): Likewise.
+ * utils.c (n_spaces): Likewise.
+ * cli/cli-script.c (document_command): Likewise.
+ * i386-windows-tdep.c (core_process_module_section): Likewise.
+ * linux-fork.c (struct fork_info) <~fork_info>: Likewise.
+
2020-05-20 Simon Marchi <simon.marchi@efficios.com>
* symfile.c (reread_symbols): Clear objfile's section_offsets
counted_command_line doclines = read_command_lines (prompt.c_str (),
from_tty, 0, 0);
- if (c->doc)
- xfree ((char *) c->doc);
+ xfree ((char *) c->doc);
{
struct command_line *cl1;
{
/* The previous copy of TYPE_NAME is allocated by
process_coff_symbol. */
- if (target->name ())
- xfree ((char*) target->name ());
+ xfree ((char *) target->name ());
target->set_name (xstrdup (real_target->name ()));
}
}
void
set_gnutarget (const char *newtarget)
{
- if (gnutarget_string != NULL)
- xfree (gnutarget_string);
+ xfree (gnutarget_string);
gnutarget_string = xstrdup (newtarget);
set_gnutarget_command (NULL, 0, NULL);
}
_("Cannot find C++ ABI \"%s\" to set it as auto default."),
short_name);
- if (auto_cp_abi.longname != NULL)
- xfree ((char *) auto_cp_abi.longname);
- if (auto_cp_abi.doc != NULL)
- xfree ((char *) auto_cp_abi.doc);
+ xfree ((char *) auto_cp_abi.longname);
+ xfree ((char *) auto_cp_abi.doc);
auto_cp_abi = *abi;
unsigned count;
count = bfd_count_sections (some_bfd);
- if (*start)
- xfree (* start);
+ xfree (*start);
*start = XNEWVEC (struct target_section, count);
*end = *start;
bfd_map_over_sections (some_bfd, add_to_section_table, (char *) end);
data->module_count++;
out:
- if (buf)
- xfree (buf);
+ xfree (buf);
return;
}
if (savedregs)
delete savedregs;
- if (filepos)
- xfree (filepos);
+
+ xfree (filepos);
}
ptid_t ptid = null_ptid;
putpkt (pass_packet);
getpkt (&rs->buf, 0);
packet_ok (rs->buf, &remote_protocol_packets[PACKET_QPassSignals]);
- if (rs->last_pass_packet)
- xfree (rs->last_pass_packet);
+ xfree (rs->last_pass_packet);
rs->last_pass_packet = pass_packet;
}
else
static void
simple_free_overlay_table (void)
{
- if (cache_ovly_table)
- xfree (cache_ovly_table);
+ xfree (cache_ovly_table);
cache_novlys = 0;
cache_ovly_table = NULL;
cache_ovly_table_base = 0;
if (n > max_spaces)
{
- if (spaces)
- xfree (spaces);
+ xfree (spaces);
spaces = (char *) xmalloc (n + 1);
for (t = spaces + n; t != spaces;)
*--t = ' ';