From db3b9a107acef30744295eb3c64237cde07a17f3 Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Thu, 3 Jul 2008 23:14:35 +0000 Subject: [PATCH] 2008-06-21 Hui Zhu * target-descriptions.c (maint_print_c_tdesc_cmd): Fix a memory leak. --- gdb/ChangeLog | 4 ++++ gdb/target-descriptions.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0cdd9355707..00b928c588c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2008-06-21 Hui Zhu + + * target-descriptions.c (maint_print_c_tdesc_cmd): Fix a memory leak. + 2008-07-03 Pedro Alves * config/i386/nm-cygwin.h (ATTACH_NO_WAIT): Delete. diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c index e1535b39875..95bf7c9724f 100644 --- a/gdb/target-descriptions.c +++ b/gdb/target-descriptions.c @@ -1013,7 +1013,7 @@ maint_print_c_tdesc_cmd (char *args, int from_tty) error (_("The current target description did not come from an XML file.")); filename = lbasename (target_description_filename); - function = xmalloc (strlen (filename) + 1); + function = alloca (strlen (filename) + 1); for (inp = filename, outp = function; *inp != '\0'; inp++) if (*inp == '.') break; -- 2.30.2