aboutsummaryrefslogtreecommitdiff
path: root/binutils/rddbg.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/rddbg.c
parentc95949892f6f1e2974a0fb8a5463d7b6432ac469 (diff)
downloadgdb-9db70fc3656064555873332003d842b880ca470c.zip
gdb-9db70fc3656064555873332003d842b880ca470c.tar.gz
gdb-9db70fc3656064555873332003d842b880ca470c.tar.bz2
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/rddbg.c')
-rw-r--r--binutils/rddbg.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/binutils/rddbg.c b/binutils/rddbg.c
index 72e9340..930dbf7 100644
--- a/binutils/rddbg.c
+++ b/binutils/rddbg.c
@@ -319,8 +319,7 @@ read_symbol_stabs_debugging_info (bfd *abfd, asymbol **syms, long symcount,
sc[strlen (sc) - 1] = '\0';
n = concat (sc, bfd_asymbol_name (*ps), (const char *) NULL);
free (sc);
- if (f != NULL)
- free (f);
+ free (f);
f = n;
s = n;
}
@@ -372,8 +371,7 @@ static int saved_stabs_index;
static void
save_stab (int type, int desc, bfd_vma value, const char *string)
{
- if (saved_stabs[saved_stabs_index].string != NULL)
- free (saved_stabs[saved_stabs_index].string);
+ free (saved_stabs[saved_stabs_index].string);
saved_stabs[saved_stabs_index].type = type;
saved_stabs[saved_stabs_index].desc = desc;
saved_stabs[saved_stabs_index].value = value;
@@ -428,11 +426,8 @@ free_saved_stabs (void)
for (i = 0; i < SAVE_STABS_COUNT; i++)
{
- if (saved_stabs[i].string != NULL)
- {
- free (saved_stabs[i].string);
- saved_stabs[i].string = NULL;
- }
+ free (saved_stabs[i].string);
+ saved_stabs[i].string = NULL;
}
saved_stabs_index = 0;