summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@specifix.com>2007-08-10 20:42:45 +0000
committerMichael Snyder <msnyder@specifix.com>2007-08-10 20:42:45 +0000
commit5307caa90e63e677c34a46197ad1de46656c8d7c (patch)
treefd2988607cc8406da1b6dd40ebbe50f96ce6f9c0
parent619b04b9efad9f3c016d3d2d3e7d99aeea3197f2 (diff)
downloadgdb-5307caa90e63e677c34a46197ad1de46656c8d7c.tar.gz
2007-08-10 Michael Snyder <msnyder@access-company.com>
* solib-svr4.c (enable_break): Don't free tmp_pathname until after closing bfd.
-rw-r--r--gdb/ChangeLog3
-rw-r--r--gdb/solib-svr4.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b3894a4c12c..2057dcc3ed2 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,8 @@
2007-08-10 Michael Snyder <msnyder@access-company.com>
+ * solib-svr4.c (enable_break): Don't free tmp_pathname until
+ after closing bfd.
+
* completer.c: Comment/whitespace cleanup.
2007-08-10 Joel Brobecker <brobecker@adacore.com>
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index 9b72a57bc0d..63918277b90 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -1008,7 +1008,6 @@ enable_break (void)
tmp_fd = solib_open (buf, &tmp_pathname);
if (tmp_fd >= 0)
tmp_bfd = bfd_fopen (tmp_pathname, gnutarget, FOPEN_RB, tmp_fd);
- xfree (tmp_pathname);
if (tmp_bfd == NULL)
goto bkpt_at_symbol;
@@ -1102,6 +1101,7 @@ enable_break (void)
/* For whatever reason we couldn't set a breakpoint in the dynamic
linker. Warn and drop into the old code. */
bkpt_at_symbol:
+ xfree (tmp_pathname);
warning (_("Unable to find dynamic linker breakpoint function.\n"
"GDB will be unable to debug shared library initializers\n"
"and track explicitly loaded dynamic code."));