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 /plugins/arm | |
parent | ff187d24b7441e88e1f0361d59b0f6f55851791f (diff) |
Fixed a huge number of memory leaks.
Diffstat (limited to 'plugins/arm')
-rw-r--r-- | plugins/arm/context.c | 5 |
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)); |