summaryrefslogtreecommitdiff
path: root/binutils/addr2line.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-05-20 22:48:41 +0930
committerAlan Modra <amodra@gmail.com>2020-05-21 10:45:33 +0930
commit9db70fc3656064555873332003d842b880ca470c (patch)
treed1aaec716012f043f5ba4aa0e43bf879a32be214 /binutils/addr2line.c
parentc95949892f6f1e2974a0fb8a5463d7b6432ac469 (diff)
downloadbinutils-gdb-9db70fc3656064555873332003d842b880ca470c.tar.gz
Replace "if (x) free (x)" with "free (x)", binutils
* addr2line.c: Replace "if (x) free (x)" with "free (x)" throughout. * dlltool.c: Likewise. * elfcomm.c: Likewise. * rddbg.c: Likewise. * readelf.c: Likewise. * stabs.c: Likewise. * windmc.c: Likewise. * windres.c: Likewise. * wrstabs.c: Likewise.
Diffstat (limited to 'binutils/addr2line.c')
-rw-r--r--binutils/addr2line.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/binutils/addr2line.c b/binutils/addr2line.c
index 4b43aec6b72..846720fc818 100644
--- a/binutils/addr2line.c
+++ b/binutils/addr2line.c
@@ -314,8 +314,7 @@ translate_addresses (bfd *abfd, asection *section)
else
printf ("\n");
- if (alloc != NULL)
- free (alloc);
+ free (alloc);
}
if (base_names && filename != NULL)
@@ -410,11 +409,8 @@ process_file (const char *file_name, const char *section_name,
translate_addresses (abfd, section);
- if (syms != NULL)
- {
- free (syms);
- syms = NULL;
- }
+ free (syms);
+ syms = NULL;
bfd_close (abfd);