summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Ethier <justin.ethier@gmail.com>2023-11-27 19:43:38 -0800
committerJustin Ethier <justin.ethier@gmail.com>2023-11-27 19:43:38 -0800
commit8bf60e9239c1c666ed42f53c73d5019460442658 (patch)
tree4caf70646b3e10a6ad8faafcfbbddac9b18e4fa4
parent132c745330ef9614b7b0c85ab230fce5f89b7883 (diff)
-rw-r--r--runtime.c3
1 files changed, 3 insertions, 0 deletions
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));