aboutsummaryrefslogtreecommitdiff
path: root/gprof
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-05-20 22:49:51 +0930
committerAlan Modra <amodra@gmail.com>2020-05-21 10:45:33 +0930
commit3d45296946ba5c0ff59c407029bee3f368cace00 (patch)
treea7193c92b99566a0c9651f57674b7327b0679790 /gprof
parent9fbb53c7c8d54ec90dc308cfb50902b90900b946 (diff)
downloadgdb-3d45296946ba5c0ff59c407029bee3f368cace00.zip
gdb-3d45296946ba5c0ff59c407029bee3f368cace00.tar.gz
gdb-3d45296946ba5c0ff59c407029bee3f368cace00.tar.bz2
Replace "if (x) free (x)" with "free (x)", gprof
* utils.c (print_name_only): Free demangled without checking first for non-NULL.
Diffstat (limited to 'gprof')
-rw-r--r--gprof/ChangeLog5
-rw-r--r--gprof/utils.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/gprof/ChangeLog b/gprof/ChangeLog
index 29043ac..59fba06 100644
--- a/gprof/ChangeLog
+++ b/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.
diff --git a/gprof/utils.c b/gprof/utils.c
index 4fc2db6..76bc57d 100644
--- a/gprof/utils.c
+++ b/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));
}