aboutsummaryrefslogtreecommitdiff
path: root/gdb/coffread.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/coffread.c')
-rw-r--r--gdb/coffread.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/coffread.c b/gdb/coffread.c
index b0a8b82..0c7e6d9 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -653,13 +653,14 @@ coff_symfile_read (struct objfile *objfile, int symfile_flags)
char *debugfile;
debugfile = find_separate_debug_file_by_debuglink (objfile);
+ make_cleanup (xfree, debugfile);
if (debugfile)
{
bfd *abfd = symfile_bfd_open (debugfile);
+ make_cleanup_bfd_unref (abfd);
symbol_file_add_separate (abfd, symfile_flags, objfile);
- xfree (debugfile);
}
}