diff options
author | Nick Clifton <nickc@redhat.com> | 2003-04-01 10:31:34 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2003-04-01 10:31:34 +0000 |
commit | e8103060e5b57cd7b06e9770da640d8ebd31fb6e (patch) | |
tree | 50674a799104ab7e04163196d7e3ac6b9bc4e78a | |
parent | 16405711e9ad55c2c81c17997e6a07a87857c297 (diff) | |
download | binutils-redhat-e8103060e5b57cd7b06e9770da640d8ebd31fb6e.tar.gz |
Make add_line_info() take a copy of the filename.
-rw-r--r-- | bfd/ChangeLog | 2 | ||||
-rw-r--r-- | bfd/dwarf2.c | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 897ab4b411..4e59f8ba0f 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -3,6 +3,8 @@ * dwarf2.c (concat_filename): Use bfd_malloc() and strdup() instead of concat(). (decode_line_info): Only free filename if it is not NULL. + (add_line_info): Make a copy of the filename when storing it into + the info structure. 2003-03-31 Andreas Schwab <schwab@suse.de> Daniel Jacobowitz <drow@mvista.com> diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index e8ebd6215f..1566b9aeef 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -901,10 +901,19 @@ add_line_info (table, address, filename, line, column, end_sequence) /* Set member data of 'info'. */ info->address = address; - info->filename = filename; info->line = line; info->column = column; info->end_sequence = end_sequence; + + amt = strlen (filename); + if (amt) + { + info->filename = bfd_alloc (table->abfd, amt + 1); + if (info->filename) + strcpy (info->filename, filename); + } + else + info->filename = NULL; } /* Extract a fully qualified filename from a line info table. |