aboutsummaryrefslogtreecommitdiff
path: root/bfd/peXXigen.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-10-14 13:34:30 +1030
committerAlan Modra <amodra@gmail.com>2019-10-14 16:47:12 +1030
commitec9bd0a22dd42327ae9943937a96f1e865fb5d46 (patch)
treea9f88543988ee484b7db067816ae25e00b431c89 /bfd/peXXigen.c
parent03f04b53b24fac848328eeafbea589d1120ccce0 (diff)
downloadgdb-ec9bd0a22dd42327ae9943937a96f1e865fb5d46.zip
gdb-ec9bd0a22dd42327ae9943937a96f1e865fb5d46.tar.gz
gdb-ec9bd0a22dd42327ae9943937a96f1e865fb5d46.tar.bz2
PR24955, libbfd terminating program on out of memory (part2)
PR 24955 * elflink.c (elf_output_implib): Don't use xmalloc. Don't ignore return value of bfd_alloc2. * peXXigen.c (_bfd_XXi_write_codeview_record): Don't use xmalloc. * pef.c (bfd_pef_print_symbol): Likewise. Don't ignore return value of bfd_get_section_contents. * som.c (som_write_space_strings): Don't use xmalloc. (som_write_symbol_strings): Likewise.
Diffstat (limited to 'bfd/peXXigen.c')
-rw-r--r--bfd/peXXigen.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
index ee6da64..ab0da7f 100644
--- a/bfd/peXXigen.c
+++ b/bfd/peXXigen.c
@@ -1216,7 +1216,10 @@ _bfd_XXi_write_codeview_record (bfd * abfd, file_ptr where, CODEVIEW_INFO *cvinf
if (bfd_seek (abfd, where, SEEK_SET) != 0)
return 0;
- buffer = xmalloc (size);
+ buffer = bfd_malloc (size);
+ if (buffer == NULL)
+ return 0;
+
cvinfo70 = (CV_INFO_PDB70 *) buffer;
H_PUT_32 (abfd, CVINFO_PDB70_CVSIGNATURE, cvinfo70->CvSignature);