[CLASSES]: Use strdup for decl_file too

Not safe to directly point to the string parameter, probably its a inline
string, not an indirect one, one more reason to create a string table...

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2006-11-03 23:56:56 -03:00
parent 41ca570938
commit 31a5245c8c
1 changed files with 3 additions and 1 deletions

View File

@ -283,7 +283,9 @@ static struct class *class__new(const unsigned int tag,
self->name = NULL;
if (name != NULL)
self->name = strdup(name);
self->decl_file = decl_file;
self->decl_file = NULL;
if (decl_file != NULL)
self->decl_file = strdup(decl_file);
self->decl_line = decl_line;
self->nr_holes = 0;
self->nr_labels = 0;