From 1800f484a229ff74101376ba771a0c8fcf1483b7 Mon Sep 17 00:00:00 2001 From: Paul Pluzhnikov Date: Thu, 8 Oct 2009 16:38:42 +0000 Subject: [PATCH] 2009-10-08 Paul Pluzhnikov PR gdb/10457 * elfread.c (elf_symtab_read): Don't use alloca in a loop. --- gdb/ChangeLog | 5 +++++ gdb/elfread.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b807c8581f5..744bf7ca03a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2009-10-08 Paul Pluzhnikov + + PR gdb/10457 + * elfread.c (elf_symtab_read): Don't use alloca in a loop. + 2009-10-07 Jan Kratochvil * i386-nat.c (i386_stopped_by_hwbp): Remove. diff --git a/gdb/elfread.c b/gdb/elfread.c index 6e79d4abbd0..767dfe6b214 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); -- 2.30.2