PR24955, libbfd terminating program on out of memory (part2)
[deliverable/binutils-gdb.git] / bfd / peXXigen.c
index ee6da6480d83f8928a8b5e42581073667df46e5d..ab0da7f53284be96a260fe608f4fda46bed168a2 100644 (file)
@@ -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);
 
This page took 0.024452 seconds and 4 git commands to generate.