diff options
author | Gary Benson <gbenson@redhat.com> | 2019-03-01 13:50:27 +0000 |
---|---|---|
committer | Gary Benson <gbenson@redhat.com> | 2019-03-01 13:50:27 +0000 |
commit | 827f438f664809b13ea59e8fabc43070dbd17645 (patch) | |
tree | c2cda8b18698a1c01b033c551ad7dd5e6a07ab6a /gdb | |
parent | 4ffd290906608e72fd98d627a24aa2c2b6ecf4ce (diff) | |
download | gdb-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')
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/coffread.c | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f7d8620..da1890a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2019-03-01 Gary Benson <gbenson@redhat.com> + + * coffread.c (coff_start_symtab): Remove unnecessary xstrdup. + 2019-02-28 Brian Vandenberg <phantall@gmail.com> Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 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 |