diff options
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/build-id.c | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 19144ed..a52624b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2015-06-24 Keith Seitz <keiths@redhat.com> + + * build-id.c (build_id_to_debug_bfd): Add cleanup to free + return value from lrealpath. + 2015-06-24 Mike Frysinger <vapier@gentoo.org> * remote-sim.c (gdbsim_open): Move sysroot update to the top. diff --git a/gdb/build-id.c b/gdb/build-id.c index ebf9f45..c89cd55 100644 --- a/gdb/build-id.c +++ b/gdb/build-id.c @@ -93,6 +93,7 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id) size_t size = build_id_len; char *s; char *filename = NULL; + struct cleanup *inner; memcpy (link, debugdir, debugdir_len); s = &link[debugdir_len]; @@ -116,7 +117,10 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id) continue; /* We expect to be silent on the non-existing files. */ + inner = make_cleanup (xfree, filename); abfd = gdb_bfd_open (filename, gnutarget, -1); + do_cleanups (inner); + if (abfd == NULL) continue; |