* coff-h8300.c (h8300_reloc16_extra_cases): Correct off by one
[deliverable/binutils-gdb.git] / bfd / srec.c
index 4b8fa4b4a5d72d01257ec5d143b08e1450cef1c4..ad7df1285888b62b92f186fb1c9e57d04ba9b815 100644 (file)
@@ -461,12 +461,9 @@ srec_scan (abfd)
              {
                if (buf != NULL)
                  free (buf);
-               buf = (bfd_byte *) malloc (bytes * 2);
+               buf = (bfd_byte *) bfd_malloc (bytes * 2);
                if (buf == NULL)
-                 {
-                   bfd_set_error (bfd_error_no_memory);
-                   goto error_return;
-                 }
+                 goto error_return;
                bufsize = bytes * 2;
              }
 
@@ -524,6 +521,7 @@ srec_scan (abfd)
                      goto error_return;
                    sec->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC;
                    sec->vma = address;
+                   sec->lma = address;
                    sec->_raw_size = bytes;
                    sec->filepos = pos;
                  }
@@ -667,12 +665,9 @@ srec_read_section (abfd, section, contents)
        {
          if (buf != NULL)
            free (buf);
-         buf = (bfd_byte *) malloc (bytes * 2);
+         buf = (bfd_byte *) bfd_malloc (bytes * 2);
          if (buf == NULL)
-           {
-             bfd_set_error (bfd_error_no_memory);
-             goto error_return;
-           }
+           goto error_return;
          bufsize = bytes * 2;
        }
 
This page took 0.023503 seconds and 4 git commands to generate.