aboutsummaryrefslogtreecommitdiff
path: root/gdb/elfread.c
diff options
context:
space:
mode:
authorPaul Pluzhnikov <ppluzhnikov@google.com>2009-10-08 16:38:42 +0000
committerPaul Pluzhnikov <ppluzhnikov@google.com>2009-10-08 16:38:42 +0000
commit1800f484a229ff74101376ba771a0c8fcf1483b7 (patch)
tree29c789277a22da78247b9636cc1e3fecddc0c0cf /gdb/elfread.c
parentda082f17971d56d64eb9f525f0f546baa3400d6a (diff)
downloadgdb-1800f484a229ff74101376ba771a0c8fcf1483b7.zip
gdb-1800f484a229ff74101376ba771a0c8fcf1483b7.tar.gz
gdb-1800f484a229ff74101376ba771a0c8fcf1483b7.tar.bz2
2009-10-08 Paul Pluzhnikov <ppluzhnikov@google.com>
PR gdb/10457 * elfread.c (elf_symtab_read): Don't use alloca in a loop.
Diffstat (limited to 'gdb/elfread.c')
-rw-r--r--gdb/elfread.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/elfread.c b/gdb/elfread.c
index 6e79d4a..767dfe6 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -535,7 +535,7 @@ elf_symtab_read (struct objfile *objfile, int type,
if (len > 4 && strcmp (sym->name + len - 4, "@plt") == 0)
{
- char *base_name = alloca (len - 4 + 1);
+ char *base_name = xmalloc (len - 4 + 1);
struct minimal_symbol *mtramp;
memcpy (base_name, sym->name, len - 4);
@@ -543,6 +543,7 @@ elf_symtab_read (struct objfile *objfile, int type,
mtramp = record_minimal_symbol (base_name, symaddr,
mst_solib_trampoline,
sym->section, objfile);
+ xfree (base_name);
if (mtramp)
{
MSYMBOL_SIZE (mtramp) = MSYMBOL_SIZE (msym);