From: Simon Marchi Date: Sat, 3 Mar 2018 04:27:46 +0000 (-0500) Subject: handle_general_set: Remove useless xstrdup X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b9671caf8fe1abd737846edf7dcd627870f986cc;p=binutils-gdb.git 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. --- 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; }