Message ID | 1345136352-10756-9-git-send-email-ehabkost@redhat.com |
---|---|
State | New |
Headers | show |
diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 0bf62da..c48de43 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -1503,8 +1503,8 @@ int cpu_x86_register(X86CPU *cpu, const char *cpu_model) { X86CPUDefinition def1, *def = &def1; Error *error = NULL; - QDict *features; - char *name; + QDict *features = NULL; + char *name = NULL; /* for CPU subclasses should go into cpu_x86_init() before object_new() */ compat_normalize_cpu_model(cpu_model, &name, &features, &error);
It's safer to initialize them than require that compat_normalize_cpu_model() always initialize them, even on errors. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- target-i386/cpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)