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