aboutsummaryrefslogtreecommitdiff
path: root/gas/config/obj-elf.c
diff options
context:
space:
mode:
authorTrevor Saunders <tbsaunde+binutils@tbsaunde.org>2016-04-02 09:27:18 -0400
committerTrevor Saunders <tbsaunde+binutils@tbsaunde.org>2016-04-03 19:52:25 -0400
commita44e2901c749445d16ba1e3875b50af9c4bbb3c5 (patch)
tree0fd9f6c7f0d43ddf168426ac7227db2ebe027412 /gas/config/obj-elf.c
parentae2689b09ff821b285159db064705068bb4cfa02 (diff)
downloadgdb-a44e2901c749445d16ba1e3875b50af9c4bbb3c5.zip
gdb-a44e2901c749445d16ba1e3875b50af9c4bbb3c5.tar.gz
gdb-a44e2901c749445d16ba1e3875b50af9c4bbb3c5.tar.bz2
use xstrdup and friends more
gas/ChangeLog: 2016-04-03 Trevor Saunders <tbsaunde+binutils@tbsaunde.org> * config/obj-elf.c (obj_elf_vendor_attribute): Use xstrdup. * config/tc-ppc.c (ppc_frob_file_before_adjust): Likewise. (ppc_znop): Likewise. (ppc_pe_section): Likewise. (ppc_frob_symbol): Likewise. * config/tc-tic30.c (tic30_operand): Likewise. * config/tc-tic4x.c (tic4x_sect): Likewise. (tic4x_usect): Likewise.
Diffstat (limited to 'gas/config/obj-elf.c')
-rw-r--r--gas/config/obj-elf.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index 1d07d4b..68290e2 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -1609,9 +1609,7 @@ obj_elf_vendor_attribute (int vendor)
if (i == 0)
goto bad;
- name = xmalloc (i + 1);
- memcpy (name, s, i);
- name[i] = '\0';
+ name = xstrndup (s, i);
#ifndef CONVERT_SYMBOLIC_ATTRIBUTE
#define CONVERT_SYMBOLIC_ATTRIBUTE(a) -1