diff options
author | Ian Lance Taylor <ian@airs.com> | 1997-11-22 21:08:09 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1997-11-22 21:08:09 +0000 |
commit | f3fb08f6c5d323d6f2fd3f6d263efa2f20a8beca (patch) | |
tree | bb68dfb63d3e146ca2ecef2ef4f263fd477caf9d /bfd | |
parent | 107dfe1267177ce3d746fa5761b34bc4a7dc3c73 (diff) | |
download | gdb-f3fb08f6c5d323d6f2fd3f6d263efa2f20a8beca.zip gdb-f3fb08f6c5d323d6f2fd3f6d263efa2f20a8beca.tar.gz gdb-f3fb08f6c5d323d6f2fd3f6d263efa2f20a8beca.tar.bz2 |
Sat Nov 22 16:06:56 1997 Klaus Kaempf <kkaempf@progis.de>
* evax-emh.c (_bfd_evax_write_emh): Use alloca instead of strdup.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 4 | ||||
-rw-r--r-- | bfd/evax-emh.c | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 74e90b2..9b20189 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -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 diff --git a/bfd/evax-emh.c b/bfd/evax-emh.c index 2b50006..9311bf0 100644 --- a/bfd/evax-emh.c +++ b/bfd/evax-emh.c @@ -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"); |