aboutsummaryrefslogtreecommitdiff
path: root/ld/ldmisc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-05-20 22:50:49 +0930
committerAlan Modra <amodra@gmail.com>2020-05-21 10:45:33 +0930
commit5e2ab6125485bede5611187f2df4b26b04026b80 (patch)
treef3884cb27e8761b535ee38e63ebee33c5cdbfea4 /ld/ldmisc.c
parent3d45296946ba5c0ff59c407029bee3f368cace00 (diff)
downloadbinutils-5e2ab6125485bede5611187f2df4b26b04026b80.zip
binutils-5e2ab6125485bede5611187f2df4b26b04026b80.tar.gz
binutils-5e2ab6125485bede5611187f2df4b26b04026b80.tar.bz2
Replace "if (x) free (x)" with "free (x)", ld
* deffilep.y: Replace "if (x) free (x)" with "free (x)" thoughout. * emultempl/elf.em: Likewise. * emultempl/msp430.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/xtensaelf.em: Likewise. * ldelf.c: Likewise. * ldfile.c: Likewise. * ldmain.c: Likewise. * ldmisc.c: Likewise. * lexsup.c: Likewise. * pe-dll.c: Likewise.
Diffstat (limited to 'ld/ldmisc.c')
-rw-r--r--ld/ldmisc.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/ld/ldmisc.c b/ld/ldmisc.c
index cc090a5..418e8d5 100644
--- a/ld/ldmisc.c
+++ b/ld/ldmisc.c
@@ -375,13 +375,11 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bfd_boolean is_warning)
abfd, functionname);
last_bfd = abfd;
- if (last_file != NULL)
- free (last_file);
+ free (last_file);
last_file = NULL;
if (filename)
last_file = xstrdup (filename);
- if (last_function != NULL)
- free (last_function);
+ free (last_function);
last_function = xstrdup (functionname);
}
discard_last = FALSE;
@@ -412,16 +410,10 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bfd_boolean is_warning)
if (discard_last)
{
last_bfd = NULL;
- if (last_file != NULL)
- {
- free (last_file);
- last_file = NULL;
- }
- if (last_function != NULL)
- {
- free (last_function);
- last_function = NULL;
- }
+ free (last_file);
+ last_file = NULL;
+ free (last_function);
+ last_function = NULL;
}
}
break;