Use ui_file_as_string throughout more
[deliverable/binutils-gdb.git] / gdb / rust-exp.y
index dffccd0605bb5ef6e2e9d25d8eabd248461a01d7..5f440890d191f74a4f9d6ab9be5f32a6be70e77c 100644 (file)
@@ -2055,13 +2055,11 @@ convert_ast_to_type (struct parser_state *state,
        obstack_1grow (&work_obstack, '(');
        for (i = 0; VEC_iterate (type_ptr, args, i, type); ++i)
          {
-           char *type_name = type_to_string (type);
+           std::string type_name = type_to_string (type);
 
            if (i > 0)
              obstack_1grow (&work_obstack, ',');
-           obstack_grow_str (&work_obstack, type_name);
-
-           xfree (type_name);
+           obstack_grow_str (&work_obstack, type_name.c_str ());
          }
 
        obstack_grow_str0 (&work_obstack, ")");
@@ -2109,13 +2107,12 @@ convert_name (struct parser_state *state, const struct rust_op *operation)
   obstack_1grow (&work_obstack, '<');
   for (i = 0; VEC_iterate (type_ptr, types, i, type); ++i)
     {
-      char *type_name = type_to_string (type);
+      std::string type_name = type_to_string (type);
 
       if (i > 0)
        obstack_1grow (&work_obstack, ',');
 
-      obstack_grow_str (&work_obstack, type_name);
-      xfree (type_name);
+      obstack_grow_str (&work_obstack, type_name.c_str ());
     }
   obstack_grow_str0 (&work_obstack, ">");
 
This page took 0.024241 seconds and 4 git commands to generate.