Skip to content

Commit

Permalink
librz/arch/ppc: fix leaks of Capstone handle (#4737)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rot127 authored Nov 25, 2024
1 parent ad4e1cd commit b91a449
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion librz/arch/p/analysis/analysis_ppc_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1744,7 +1744,6 @@ static int analyze_op(RzAnalysis *a, RzAnalysisOp *op, ut64 addr, const ut8 *buf
rz_strbuf_fini(&op->esil);
}
cs_free(insn, n);
// cs_close (&handle);
}
return op->size;
}
Expand Down Expand Up @@ -1780,6 +1779,7 @@ static RzAnalysisILConfig *il_config(RzAnalysis *analysis) {

static bool ppc_fini(void *user) {
PPCContext *ctx = (PPCContext *)user;
cs_close(&ctx->handle);
if (ctx) {
RZ_FREE(ctx);
}
Expand Down

0 comments on commit b91a449

Please sign in to comment.