Message ID | 1550848393-2743-1-git-send-email-gbenson@redhat.com |
---|---|
State | New |
Headers | show |
>>>>> "Gary" == Gary Benson <gbenson@redhat.com> writes:
Gary> Hi all,
Gary> This commit fixes a resource leak found by Coverity, where
Gary> coff_start_symtab performs an xstrdup that is now performed
Gary> within start_symtab by buildsym_compunit::buildsym_compunit.
Gary> Built and regtested on RHEL 7.6 x86_64.
Gary> Ok to commit?
Yes, thank you.
Tom
Tom Tromey wrote: > >>>>> "Gary" == Gary Benson <gbenson@redhat.com> writes: > > Gary> Hi all, > Gary> This commit fixes a resource leak found by Coverity, where > Gary> coff_start_symtab performs an xstrdup that is now performed > Gary> within start_symtab by buildsym_compunit::buildsym_compunit. > > Gary> Built and regtested on RHEL 7.6 x86_64. > > Gary> Ok to commit? > > Yes, thank you. Thanks, I pushed it. Cheers, Gary
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