From 8bf60e9239c1c666ed42f53c73d5019460442658 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Mon, 27 Nov 2023 19:43:38 -0800 Subject: [PATCH] Free memory --- runtime.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime.c b/runtime.c index 0182cd3d..9532a263 100644 --- a/runtime.c +++ b/runtime.c @@ -2653,6 +2653,9 @@ double string2rational(void *data, char *s) Cyc_rt_raise2(data, "Error converting string to bignum", denom); } + // Prevent memory leak + free(nom); + // Compute final result as double double x = mp_get_double(&bignum_value(bn_nom)); double y = mp_get_double(&bignum_value(bn_denom));