Skip to content

Commit

Permalink
Free memory
Browse files Browse the repository at this point in the history
  • Loading branch information
justinethier committed Nov 28, 2023
1 parent 132c745 commit 8bf60e9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 8bf60e9

Please sign in to comment.