Remove cleanup from complaints.c
[deliverable/binutils-gdb.git] / gdb / complaints.c
index aba305c72925c74520a3bee1c893abfc3583bc5b..58b6b7b51c3b477de20dd104817436ccd3bb2deb 100644 (file)
@@ -192,16 +192,14 @@ vcomplaint (struct complaints **c, const char *file,
        vwarning (fmt, args);
       else
        {
-         char *msg;
-         struct cleanup *cleanups;
-         msg = xstrvprintf (fmt, args);
-         cleanups = make_cleanup (xfree, msg);
+         std::string msg = string_vprintf (fmt, args);
          wrap_here ("");
          if (series != SUBSEQUENT_MESSAGE)
            begin_line ();
          /* XXX: i18n */
          fprintf_filtered (gdb_stderr, "%s%s%s",
-                           complaints->explanation[series].prefix, msg,
+                           complaints->explanation[series].prefix,
+                           msg.c_str (),
                            complaints->explanation[series].postfix);
          /* Force a line-break after any isolated message.  For the
              other cases, clear_complaints() takes care of any missing
@@ -214,7 +212,6 @@ vcomplaint (struct complaints **c, const char *file,
            fputs_filtered ("\n", gdb_stderr);
          else
            wrap_here ("");
-         do_cleanups (cleanups);
        }
     }
 
This page took 0.024058 seconds and 4 git commands to generate.