aboutsummaryrefslogtreecommitdiff
path: root/gdb/coffread.c
diff options
context:
space:
mode:
authorGary Benson <gbenson@redhat.com>2019-03-01 13:50:27 +0000
committerGary Benson <gbenson@redhat.com>2019-03-01 13:50:27 +0000
commit827f438f664809b13ea59e8fabc43070dbd17645 (patch)
treec2cda8b18698a1c01b033c551ad7dd5e6a07ab6a /gdb/coffread.c
parent4ffd290906608e72fd98d627a24aa2c2b6ecf4ce (diff)
downloadgdb-827f438f664809b13ea59e8fabc43070dbd17645.zip
gdb-827f438f664809b13ea59e8fabc43070dbd17645.tar.gz
gdb-827f438f664809b13ea59e8fabc43070dbd17645.tar.bz2
Fix coff_start_symtab resource leak found by Coverity
This commit fixes a resource leak found by Coverity, where coff_start_symtab performs an xstrdup that is now performed within start_symtab by buildsym_compunit::buildsym_compunit. gdb/ChangeLog: * coffread.c (coff_start_symtab): Remove unnecessary xstrdup.
Diffstat (limited to 'gdb/coffread.c')
-rw-r--r--gdb/coffread.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 6381cd3..91a112e 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -385,10 +385,7 @@ coff_start_symtab (struct objfile *objfile, const char *name)
{
within_function = 0;
start_symtab (objfile,
- /* We fill in the filename later. start_symtab puts this pointer
- into last_source_file and we put it in subfiles->name, which
- end_symtab frees; that's why it must be malloc'd. */
- xstrdup (name),
+ name,
/* We never know the directory name for COFF. */
NULL,
/* The start address is irrelevant, since we call