Fix memory leak
This commit is contained in:
parent
3b667338cf
commit
a06563ecdd
|
@ -294,7 +294,7 @@ S390CPU *cpu_s390_init(struct uc_struct *uc, const char *cpu_model)
|
|||
// init addresss space
|
||||
cpu_address_space_init(cs, 0, cs->memory);
|
||||
|
||||
qemu_init_vcpu(cs);
|
||||
//qemu_init_vcpu(cs);
|
||||
|
||||
return cpu;
|
||||
}
|
||||
|
|
|
@ -414,6 +414,7 @@ void s390_cpu_model_finalize(CPUState *obj)
|
|||
S390CPU *cpu = S390_CPU(obj);
|
||||
|
||||
g_free(cpu->model);
|
||||
g_free(cpu->ss.keydata);
|
||||
cpu->model = NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,10 +16,10 @@ static void s390_set_pc(struct uc_struct *uc, uint64_t address)
|
|||
|
||||
static void s390_release(void *ctx)
|
||||
{
|
||||
#if 0
|
||||
|
||||
int i;
|
||||
TCGContext *tcg_ctx = (TCGContext *)ctx;
|
||||
S390XCPU *cpu = (S390XCPU *)tcg_ctx->uc->cpu;
|
||||
S390CPU *cpu = (S390CPU *)tcg_ctx->uc->cpu;
|
||||
CPUTLBDesc *d = cpu->neg.tlb.d;
|
||||
CPUTLBDescFast *f = cpu->neg.tlb.f;
|
||||
CPUTLBDesc *desc;
|
||||
|
@ -32,11 +32,6 @@ static void s390_release(void *ctx)
|
|||
g_free(desc->iotlb);
|
||||
g_free(fast->table);
|
||||
}
|
||||
#endif
|
||||
TCGContext *tcg_ctx = (TCGContext *)ctx;
|
||||
S390CPU *cpu = (S390CPU *)tcg_ctx->uc->cpu;
|
||||
|
||||
release_common(ctx);
|
||||
|
||||
s390_cpu_model_finalize((CPUState *)cpu);
|
||||
// TODO: Anymore to free?
|
||||
|
|
Loading…
Reference in New Issue