plugin_get_ir_dummy_bfd leak

* plugin.c (plugin_get_ir_dummy_bfd): Free bfd filename.
This commit is contained in:
Alan Modra
2025-01-11 16:17:20 +10:30
parent 64d357bc45
commit 82a944eda3

View File

@@ -315,12 +315,11 @@ plugin_opt_plugin_arg (const char *arg)
static bfd *
plugin_get_ir_dummy_bfd (const char *name, bfd *srctemplate)
{
bfd *abfd;
bool bfd_plugin_target;
bfd_plugin_target = bfd_plugin_target_p (srctemplate->xvec);
abfd = bfd_create (concat (name, IRONLY_SUFFIX, (const char *) NULL),
bfd_plugin_target ? link_info.output_bfd : srctemplate);
bool bfd_plugin_target = bfd_plugin_target_p (srctemplate->xvec);
char *filename = concat (name, IRONLY_SUFFIX, (const char *) NULL);
bfd *abfd = bfd_create (filename, (bfd_plugin_target
? link_info.output_bfd : srctemplate));
free (filename);
if (abfd != NULL)
{
abfd->flags |= BFD_LINKER_CREATED | BFD_PLUGIN;