diff options
author | Justin Ethier <justin.ethier@gmail.com> | 2023-11-27 19:43:38 -0800 |
---|---|---|
committer | Justin Ethier <justin.ethier@gmail.com> | 2023-11-27 19:43:38 -0800 |
commit | 8bf60e9239c1c666ed42f53c73d5019460442658 (patch) | |
tree | 4caf70646b3e10a6ad8faafcfbbddac9b18e4fa4 | |
parent | 132c745330ef9614b7b0c85ab230fce5f89b7883 (diff) |
Free memoryissue-513-parsing-of-rationals
-rw-r--r-- | runtime.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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)); |