mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-05 21:50:21 +08:00
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.
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user