diff options
Diffstat (limited to 'target-sparc/translate.c')
-rw-r--r-- | target-sparc/translate.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/target-sparc/translate.c b/target-sparc/translate.c index 6340e15225..8a8620fcf2 100644 --- a/target-sparc/translate.c +++ b/target-sparc/translate.c @@ -2672,11 +2672,10 @@ CPUSPARCState *cpu_sparc_init(void) { CPUSPARCState *env; - cpu_exec_init(); - - if (!(env = malloc(sizeof(CPUSPARCState)))) - return (NULL); - cpu_single_env = env; + env = qemu_mallocz(sizeof(CPUSPARCState)); + if (!env) + return NULL; + cpu_exec_init(env); cpu_reset(env); return (env); } |