diff options
Diffstat (limited to 'gdb/exec.c')
-rw-r--r-- | gdb/exec.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -217,8 +217,11 @@ exec_file_attach (char *filename, int from_tty) scratch_chan); if (!exec_bfd) - error (_("\"%s\": could not open as an executable file: %s"), - scratch_pathname, bfd_errmsg (bfd_get_error ())); + { + close (scratch_chan); + error (_("\"%s\": could not open as an executable file: %s"), + scratch_pathname, bfd_errmsg (bfd_get_error ())); + } /* At this point, scratch_pathname and exec_bfd->name both point to the same malloc'd string. However exec_close() will attempt to free it |