handle_general_set: Remove useless xstrdup
authorSimon Marchi <simon.marchi@polymtl.ca>
Sat, 3 Mar 2018 04:27:46 +0000 (23:27 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Sat, 3 Mar 2018 04:27:47 +0000 (23:27 -0500)
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
gdb/gdbserver/server.c

index 70a93876db34ba2be706c617f122a0ae19acea23..f7de928d18c9d7e0d05041fb1515e21775746b34 100644 (file)
@@ -1,3 +1,7 @@
+2018-03-02  Simon Marchi  <simon.marchi@polymtl.ca>
+
+       * server.c (handle_general_set): Remove unnecessary xstrdup.
+
 2018-03-02  Simon Marchi  <simon.marchi@polymtl.ca>
 
        * server.c (parse_debug_format_options): Adjust to
index afdd5049a771da6e41982fbd4d75dd2c400b7fd4..64c72bdd58c3cc505832d488efe07c36bbeaf711 100644 (file)
@@ -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;
        }