From b91a44905c7b57cfa79b4b9870d4e60904173899 Mon Sep 17 00:00:00 2001 From: Rot127 <45763064+Rot127@users.noreply.github.com> Date: Mon, 25 Nov 2024 12:25:56 +0000 Subject: [PATCH] librz/arch/ppc: fix leaks of Capstone handle (#4737) --- librz/arch/p/analysis/analysis_ppc_cs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/librz/arch/p/analysis/analysis_ppc_cs.c b/librz/arch/p/analysis/analysis_ppc_cs.c index 056f226f836..4952c15464a 100644 --- a/librz/arch/p/analysis/analysis_ppc_cs.c +++ b/librz/arch/p/analysis/analysis_ppc_cs.c @@ -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; } @@ -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); }