]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - ld/emultempl/xtensaelf.em
Replace "if (x) free (x)" with "free (x)", ld
[thirdparty/binutils-gdb.git] / ld / emultempl / xtensaelf.em
index 2d9f594969f54a3e6a8065e72e731fa0342a1a93..932721c6f16d086c6854df5b199c191cb125bbc1 100644 (file)
@@ -216,18 +216,15 @@ replace_insn_sec_with_prop_sec (bfd *abfd,
 
   remove_section (abfd, insn_sec);
 
-  if (insn_contents)
-    free (insn_contents);
+  free (insn_contents);
 
   return TRUE;
 
  cleanup:
   if (prop_sec && prop_sec->owner)
     remove_section (abfd, prop_sec);
-  if (insn_contents)
-    free (insn_contents);
-  if (internal_relocs)
-    free (internal_relocs);
+  free (insn_contents);
+  free (internal_relocs);
 
   return FALSE;
 }
@@ -271,8 +268,7 @@ replace_instruction_table_sections (bfd *abfd, asection *sec)
                 insn_sec_name, abfd, message);
        }
     }
-  if (owned_prop_sec_name)
-    free (owned_prop_sec_name);
+  free (owned_prop_sec_name);
 }
 
 
@@ -636,8 +632,7 @@ xtensa_append_section_deps (reloc_deps_graph *deps, asection *sec)
        {
          new_sections[i] = deps->sections[i];
        }
-      if (deps->sections != NULL)
-       free (deps->sections);
+      free (deps->sections);
       deps->sections = new_sections;
       deps->size = new_size;
     }
@@ -675,9 +670,7 @@ free_reloc_deps_graph (reloc_deps_graph *deps)
        }
       xtensa_set_section_deps (deps, sec, NULL);
     }
-  if (deps->sections)
-    free (deps->sections);
-
+  free (deps->sections);
   free (deps);
 }