From b9671caf8fe1abd737846edf7dcd627870f986cc Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 2 Mar 2018 23:27:46 -0500 Subject: [PATCH] handle_general_set: Remove useless xstrdup Unless I'm missing something very obvious, this xstrdup seems unnecessary to me. We can pass "mode" directly to sprintf. gdb/gdbserver/ChangeLog: * server.c (handle_general_set): Remove unnecessary xstrdup. --- gdb/gdbserver/ChangeLog | 4 ++++ gdb/gdbserver/server.c | 5 +---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 70a93876db3..f7de928d18c 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,7 @@ +2018-03-02 Simon Marchi + + * server.c (handle_general_set): Remove unnecessary xstrdup. + 2018-03-02 Simon Marchi * server.c (parse_debug_format_options): Adjust to diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c index afdd5049a77..64c72bdd58c 100644 --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -847,12 +847,9 @@ handle_general_set (char *own_buf) req = TRIBOOL_TRUE; else { - char *mode_copy = xstrdup (mode); - /* We don't know what this mode is, so complain to GDB. */ sprintf (own_buf, "E.Unknown thread-events mode requested: %s\n", - mode_copy); - xfree (mode_copy); + mode); return; } -- 2.30.2