From 9f0d4cc7464bc6849c2c20961d49faae16e1416b Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 31 Jul 2003 06:14:26 +0000 Subject: [PATCH] must use save_string when source of string is unknown :P --- tools/qfcc/source/struct.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/qfcc/source/struct.c b/tools/qfcc/source/struct.c index 6bb787098..817941808 100644 --- a/tools/qfcc/source/struct.c +++ b/tools/qfcc/source/struct.c @@ -88,7 +88,8 @@ new_struct_field (struct_t *strct, type_t *type, const char *name, return 0; field = malloc (sizeof (struct_field_t)); field->visibility = visibility; - field->name = name; + if (name) + field->name = save_string (name); field->type = type; if (strct->stype == str_union) { int size = type_size (type); @@ -147,7 +148,8 @@ get_struct (const char *name, int create) return s; } s = calloc (sizeof (struct_t), 1); - s->name = name; + if (name) + s->name = save_string (name); s->return_addr = __builtin_return_address (0); if (name) Hash_Add (structs, s);