diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2019-02-05 22:03:38 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2019-02-05 22:03:38 (GMT) |
commit | 17f591f2230ac66394467d5e5eefe71cb259637d (patch) | |
tree | 1664e994b2904e5e9009027fc57749a11667365b /src/arch/target.c | |
parent | ff187d24b7441e88e1f0361d59b0f6f55851791f (diff) |
Fixed a huge number of memory leaks.
Diffstat (limited to 'src/arch/target.c')
-rw-r--r-- | src/arch/target.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/arch/target.c b/src/arch/target.c index 64b12dd..d3bd89a 100644 --- a/src/arch/target.c +++ b/src/arch/target.c @@ -51,6 +51,7 @@ struct _GTargetOperand vmpa2t addr; /* Adresse de l'élément visé */ bool strict; /* Résolution stricte */ + /* Référence circulaire */ GBinSymbol *symbol; /* Eventuel symbole associé */ phys_t diff; /* Position dans le symbole */ @@ -206,9 +207,6 @@ static void g_target_operand_targetable_interface_init(GTargetableOperandInterfa static void g_target_operand_dispose(GTargetOperand *operand) { - if (operand->symbol != NULL) - g_object_unref(G_OBJECT(operand->symbol)); - G_OBJECT_CLASS(g_target_operand_parent_class)->dispose(G_OBJECT(operand)); } @@ -505,9 +503,6 @@ bool g_target_operand_resolve(GTargetOperand *operand, GBinFormat *format, bool const mrange_t *range; /* Couverture du symbole */ #endif - if (operand->symbol != NULL) - g_object_unref(G_OBJECT(operand->symbol)); - operand->strict = strict; result = g_binary_format_resolve_symbol(format, &operand->addr, strict, &operand->symbol, &operand->diff); @@ -553,6 +548,10 @@ bool g_target_operand_resolve(GTargetOperand *operand, GBinFormat *format, bool } + /* Référence circulaire */ + if (operand->symbol != NULL) + g_object_unref(operand->symbol); + return result; } |