]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - bfd/pef.c
Remove use of alloca.
[thirdparty/binutils-gdb.git] / bfd / pef.c
index b08202d153e710b72fb803ae9d5dbdf028ee21a8..fb9a07abd156f322fc694c8df1485c9f658bb378 100644 (file)
--- a/bfd/pef.c
+++ b/bfd/pef.c
@@ -217,7 +217,7 @@ bfd_pef_print_symbol (bfd *abfd,
       fprintf (file, " %-5s %s", symbol->section->name, symbol->name);
       if (CONST_STRNEQ (symbol->name, "__traceback_"))
        {
-         unsigned char *buf = alloca (symbol->udata.i);
+         unsigned char *buf = xmalloc (symbol->udata.i);
          size_t offset = symbol->value + 4;
          size_t len = symbol->udata.i;
          int ret;
@@ -227,6 +227,7 @@ bfd_pef_print_symbol (bfd *abfd,
                                               len, 0, NULL, file);
          if (ret < 0)
            fprintf (file, " [ERROR]");
+         free (buf);
        }
     }
 }