From 168088927f270e255891c917f431645a5d9b4188 Mon Sep 17 00:00:00 2001 From: pancake Date: Wed, 8 Feb 2023 20:42:46 +0100 Subject: [PATCH] Fix another memleak that may be properly fixed with reftype in 5.9 --- libr/core/core.c | 1 + libr/include/r_util/r_num.h | 1 + 2 files changed, 2 insertions(+) diff --git a/libr/core/core.c b/libr/core/core.c index 0f509e9d65..abd8db9705 100644 --- a/libr/core/core.c +++ b/libr/core/core.c @@ -3176,6 +3176,7 @@ R_API bool r_core_init(RCore *core) { r_bin_bind (core->bin, &(core->anal->binb)); r_bin_bind (core->bin, &(core->anal->arch->binb)); + r_num_free (core->anal->arch->num); core->anal->arch->num = core->num; r_io_bind (core->io, &(core->search->iob)); r_io_bind (core->io, &(core->print->iob)); diff --git a/libr/include/r_util/r_num.h b/libr/include/r_util/r_num.h index 5d169d20a0..267a9a6ba4 100644 --- a/libr/include/r_util/r_num.h +++ b/libr/include/r_util/r_num.h @@ -55,6 +55,7 @@ typedef struct r_num_t { void *userptr; int dbz; /// division by zero happened RNumCalc nc; +// R2_590 R_REF_TYPE } RNum; typedef ut64 (*RNumCallback)(struct r_num_t *self, const char *str, int *ok);