Sat Nov 22 16:06:56 1997 Klaus Kaempf <kkaempf@progis.de>
authorIan Lance Taylor <ian@airs.com>
Sat, 22 Nov 1997 21:08:09 +0000 (21:08 +0000)
committerIan Lance Taylor <ian@airs.com>
Sat, 22 Nov 1997 21:08:09 +0000 (21:08 +0000)
* evax-emh.c (_bfd_evax_write_emh): Use alloca instead of strdup.

bfd/ChangeLog
bfd/evax-emh.c

index 74e90b20ebd5cb7f04e19bbdabb13beff61d6138..9b201895f619c58760015ed7a2fc611e03ceed25 100644 (file)
@@ -1,3 +1,7 @@
+Sat Nov 22 16:06:56 1997  Klaus Kaempf  <kkaempf@progis.de>
+
+       * evax-emh.c (_bfd_evax_write_emh): Use alloca instead of strdup.
+
 Sat Nov 22 12:29:30 1997  Ian Lance Taylor  <ian@cygnus.com>
 
        * elf32-sh.c (sh_elf_relax_delete_bytes): Don't kill LABEL
index 2b5000622224ab67aefd9cbf7575799b8cde717d..9311bf0959df9860487fb3e196da663c2728a364 100644 (file)
@@ -202,12 +202,9 @@ _bfd_evax_write_emh (abfd)
 
       char *fname, *fout, *fptr;
 
-      fname = strdup (bfd_get_filename (abfd));
-      if (fname == 0)
-       {
-         bfd_set_error (bfd_error_no_memory);
-         return -1;
-       }
+      fptr = bfd_get_filename (abfd);
+      fname = (char *) alloca (strlen (fptr) + 1);
+      strcpy (fname, fptr);
       fout = strrchr (fname, ']');
       if (fout == 0)
        fout = strchr (fname, ':');
@@ -234,7 +231,6 @@ _bfd_evax_write_emh (abfd)
            *fptr = 0;
        }
       _bfd_evax_output_counted (abfd, fout);
-      free (fname);
     }
   else
     _bfd_evax_output_counted (abfd, "NONAME");
This page took 0.032925 seconds and 4 git commands to generate.