Browse Source

Replace "if (x) free (x)" with "free (x)", gprof

* utils.c (print_name_only): Free demangled without checking
	first for non-NULL.
binutils-2_35-branch
Alan Modra 6 years ago
parent
commit
3d45296946
  1. 5
      gprof/ChangeLog
  2. 5
      gprof/utils.c

5
gprof/ChangeLog

@ -1,3 +1,8 @@
2020-05-21 Alan Modra <amodra@gmail.com>
* utils.c (print_name_only): Free demangled without checking
first for non-NULL.
2020-05-18 Nick Clifton <nickc@redhat.com>
* po/es.po: Update Spanish translation.

5
gprof/utils.c

@ -85,10 +85,7 @@ print_name_only (Sym *self)
printf ("%s", buf);
size += strlen (buf);
}
if (demangled)
{
free (demangled);
}
free (demangled);
DBG (DFNDEBUG, printf ("{%d} ", self->cg.top_order));
DBG (PROPDEBUG, printf ("%4.0f%% ", 100.0 * self->cg.prop.fract));
}

Loading…
Cancel
Save