aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-lang.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/c-lang.c')
-rw-r--r--gdb/c-lang.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index d24b0c8..ecc1e79 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -356,14 +356,11 @@ c_get_string (struct value *value, gdb_byte **buffer,
error:
{
- char *type_str;
-
- type_str = type_to_string (type);
- if (type_str)
+ std::string type_str = type_to_string (type);
+ if (!type_str.empty ())
{
- make_cleanup (xfree, type_str);
error (_("Trying to read string with inappropriate type `%s'."),
- type_str);
+ type_str.c_str ());
}
else
error (_("Trying to read string with inappropriate type."));