diff options
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/linux-nat.c | 9 |
2 files changed, 7 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ad6174b..2a75839 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2018-01-17 Simon Marchi <simon.marchi@ericsson.com> + + * linux-nat.c (linux_nat_attach): Remove xstrdup. + 2018-01-17 Eldar Abusalimov <eldar.abusalimov@jetbrains.com> PR gdb/21559 diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index c41ea39..d26ab7d 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -1224,10 +1224,7 @@ linux_nat_attach (struct target_ops *ops, const char *args, int from_tty) { pid_t pid = parse_pid_to_attach (args); struct buffer buffer; - char *message, *buffer_s; - - message = xstrdup (ex.message); - make_cleanup (xfree, message); + char *buffer_s; buffer_init (&buffer); linux_ptrace_attach_fail_reason (pid, &buffer); @@ -1237,9 +1234,9 @@ linux_nat_attach (struct target_ops *ops, const char *args, int from_tty) make_cleanup (xfree, buffer_s); if (*buffer_s != '\0') - throw_error (ex.error, "warning: %s\n%s", buffer_s, message); + throw_error (ex.error, "warning: %s\n%s", buffer_s, ex.message); else - throw_error (ex.error, "%s", message); + throw_error (ex.error, "%s", ex.message); } END_CATCH |