summaryrefslogtreecommitdiff
path: root/plugins/arm
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-02-05 22:03:38 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-02-05 22:03:38 (GMT)
commit17f591f2230ac66394467d5e5eefe71cb259637d (patch)
tree1664e994b2904e5e9009027fc57749a11667365b /plugins/arm
parentff187d24b7441e88e1f0361d59b0f6f55851791f (diff)
Fixed a huge number of memory leaks.
Diffstat (limited to 'plugins/arm')
-rw-r--r--plugins/arm/context.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/arm/context.c b/plugins/arm/context.c
index 6b62760..8f6ab52 100644
--- a/plugins/arm/context.c
+++ b/plugins/arm/context.c
@@ -140,6 +140,9 @@ static void g_arm_context_dispose(GArmContext *ctx)
static void g_arm_context_finalize(GArmContext *ctx)
{
+ if (ctx->areas != NULL)
+ free(ctx->areas);
+
G_OBJECT_CLASS(g_arm_context_parent_class)->finalize(G_OBJECT(ctx));
}
@@ -240,7 +243,7 @@ void _g_arm_context_define_encoding(GArmContext *ctx, virt_t addr, unsigned int
/* Sinon on redivise... */
else
{
- ctx->areas = (disass_arm_area *)realloc(ctx->areas, ++ctx->acount * sizeof(disass_arm_area));
+ ctx->areas = realloc(ctx->areas, ++ctx->acount * sizeof(disass_arm_area));
memmove(&ctx->areas[selected + 1], &ctx->areas[selected],
(ctx->acount - selected - 1) * sizeof(disass_arm_area));