gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / bfd / srec.c
index 1b3ead81b23f0df8919fd8aa2e31670d11d023e2..ef7eb43995902693aaf410373e327da178973b6b 100644 (file)
@@ -493,8 +493,7 @@ srec_scan (bfd *abfd)
 
            if (bytes * 2 > bufsize)
              {
-               if (buf != NULL)
-                 free (buf);
+               free (buf);
                buf = (bfd_byte *) bfd_malloc ((bfd_size_type) bytes * 2);
                if (buf == NULL)
                  goto error_return;
@@ -618,9 +617,7 @@ srec_scan (bfd *abfd)
                    goto error_return;
                  }
 
-               if (buf != NULL)
-                 free (buf);
-
+               free (buf);
                return TRUE;
              }
          }
@@ -631,16 +628,12 @@ srec_scan (bfd *abfd)
   if (error)
     goto error_return;
 
-  if (buf != NULL)
-    free (buf);
-
+  free (buf);
   return TRUE;
 
  error_return:
-  if (symbuf != NULL)
-    free (symbuf);
-  if (buf != NULL)
-    free (buf);
+  free (symbuf);
+  free (buf);
   return FALSE;
 }
 
@@ -751,8 +744,7 @@ srec_read_section (bfd *abfd, asection *section, bfd_byte *contents)
 
       if (bytes * 2 > bufsize)
        {
-         if (buf != NULL)
-           free (buf);
+         free (buf);
          buf = (bfd_byte *) bfd_malloc ((bfd_size_type) bytes * 2);
          if (buf == NULL)
            goto error_return;
@@ -768,8 +760,7 @@ srec_read_section (bfd *abfd, asection *section, bfd_byte *contents)
        {
        default:
          BFD_ASSERT (sofar == section->size);
-         if (buf != NULL)
-           free (buf);
+         free (buf);
          return TRUE;
 
        case '3':
@@ -793,8 +784,7 @@ srec_read_section (bfd *abfd, asection *section, bfd_byte *contents)
            {
              /* We've come to the end of this section.  */
              BFD_ASSERT (sofar == section->size);
-             if (buf != NULL)
-               free (buf);
+             free (buf);
              return TRUE;
            }
 
@@ -817,14 +807,11 @@ srec_read_section (bfd *abfd, asection *section, bfd_byte *contents)
 
   BFD_ASSERT (sofar == section->size);
 
-  if (buf != NULL)
-    free (buf);
-
+  free (buf);
   return TRUE;
 
  error_return:
-  if (buf != NULL)
-    free (buf);
+  free (buf);
   return FALSE;
 }
 
This page took 0.032165 seconds and 4 git commands to generate.