From 6d4ea3a54939bb89182b6def9263b5aa6b9afc52 Mon Sep 17 00:00:00 2001 From: "K. Richard Pixley" Date: Sat, 13 Feb 1993 01:40:33 +0000 Subject: [PATCH] (process_linenos): free the previously allocated subfile name, then allocate the new one from the heap. --- gdb/ChangeLog | 2 ++ gdb/xcoffread.c | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index cdd7d07..9cf6684 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -3,6 +3,8 @@ Fri Feb 12 15:46:49 1993 K. Richard Pixley (rich@cygnus.com) * xcoffread.c (process_xcoff_symbol, read_symbol_lineno): complain expects a pointer to complaint rather than a complaint structure. + (process_linenos): free the previously allocated subfile name, + then allocate the new one from the heap. Fri Feb 12 08:06:05 1993 Steve Chamberlain (sac@thepub.cygnus.com) diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 892adb5..f7fc30d 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -630,9 +630,8 @@ process_linenos (start, end) /* start_subfile (inclTable[ii].name, (char*)0); */ start_subfile (" ?", (char*)0); - current_subfile->name = - obsavestring (inclTable[ii].name, strlen (inclTable[ii].name), - ¤t_objfile->symbol_obstack); + free (current_subfile->name); + current_subfile->name = strdup (inclTable[ii].name); if (lv == lineTb) { current_subfile->line_vector = (struct linetable *) -- 2.7.4