summaryrefslogtreecommitdiff
path: root/gdb/target-descriptions.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/target-descriptions.c')
-rw-r--r--gdb/target-descriptions.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c
index 33ae1fa7eb..9a7e2ddfbd 100644
--- a/gdb/target-descriptions.c
+++ b/gdb/target-descriptions.c
@@ -128,8 +128,10 @@ enum tdesc_type_kind
typedef struct tdesc_type
{
- /* The name of this type. */
- char *name;
+ /* The name of this type. If this type is a built-in type, this is
+ a pointer to a constant string. Otherwise, it's a
+ malloc-allocated string (and thus must be freed). */
+ const char *name;
/* Identify the kind of this type. */
enum tdesc_type_kind kind;
@@ -1335,7 +1337,7 @@ tdesc_free_type (struct tdesc_type *type)
break;
}
- xfree (type->name);
+ xfree ((char *) type->name);
xfree (type);
}