From 9e49939dabf48a519e04e42422ff2b43ca884583 Mon Sep 17 00:00:00 2001 From: Nibble Date: Thu, 17 Jun 2010 10:04:51 +0200 Subject: [PATCH] * Revert wrong "bb memory leak" fix (again xD) - RAnalBlock must keep a list of the analyzed opcodes - Those RAnalOp are not freed because they are added to this list --- libr/anal/bb.c | 5 ----- libr/core/anal.c | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/libr/anal/bb.c b/libr/anal/bb.c index 4ee87aa35a..48376aab6c 100644 --- a/libr/anal/bb.c +++ b/libr/anal/bb.c @@ -75,23 +75,18 @@ R_API int r_anal_bb(RAnal *anal, RAnalBlock *bb, ut64 addr, ut8 *buf, ut64 len, bb->fail = aop->fail; bb->jump = aop->jump; bb->type |= R_ANAL_BB_TYPE_BODY; - r_anal_aop_free (aop); return R_ANAL_RET_END; case R_ANAL_OP_TYPE_JMP: bb->jump = aop->jump; bb->type |= R_ANAL_BB_TYPE_BODY; - r_anal_aop_free (aop); return R_ANAL_RET_END; case R_ANAL_OP_TYPE_UJMP: bb->type |= R_ANAL_BB_TYPE_FOOT; - r_anal_aop_free (aop); return R_ANAL_RET_END; case R_ANAL_OP_TYPE_RET: bb->type |= R_ANAL_BB_TYPE_LAST; - r_anal_aop_free (aop); return R_ANAL_RET_END; } - r_anal_aop_free (aop); } return bb->size; } diff --git a/libr/core/anal.c b/libr/core/anal.c index f9861231b1..2ba32ad3a2 100644 --- a/libr/core/anal.c +++ b/libr/core/anal.c @@ -77,6 +77,7 @@ static void r_core_anal_graph_nodes(RCore *core, RList *pbb, ut64 addr, int opts bbc = R_NEW (RAnalBlock); if (bbc) { memcpy (bbc, bbi, sizeof (RAnalBlock)); + /* We don't want to free this refs when the temporary list is destroyed */ bbc->aops = NULL; bbc->fingerprint = NULL; bbc->cond = NULL;