summaryrefslogtreecommitdiff
path: root/binutils/dlltool.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/dlltool.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/dlltool.c')
-rw-r--r--binutils/dlltool.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/binutils/dlltool.c b/binutils/dlltool.c
index 734c727a065..d22ff54e098 100644
--- a/binutils/dlltool.c
+++ b/binutils/dlltool.c
@@ -1253,8 +1253,7 @@ def_import (const char *app_name, const char *module, const char *dllext,
append_import (application_name, module, ord_val, its_name);
- if (buf)
- free (buf);
+ free (buf);
}
void
@@ -1335,7 +1334,7 @@ run (const char *what, char *args)
pid = pexecute (argv[0], (char * const *) argv, program_name, temp_base,
&errmsg_fmt, &errmsg_arg, PEXECUTE_ONE | PEXECUTE_SEARCH);
- free(argv);
+ free (argv);
if (pid == -1)
{
@@ -3388,15 +3387,8 @@ dll_name_list_free_contents (dll_name_list_node_type * entry)
if (entry)
{
if (entry->next)
- {
- dll_name_list_free_contents (entry->next);
- entry->next = NULL;
- }
- if (entry->dllname)
- {
- free (entry->dllname);
- entry->dllname = NULL;
- }
+ dll_name_list_free_contents (entry->next);
+ free (entry->dllname);
free (entry);
}
}