summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlin Bingham <cb@viennan.net>2018-01-21 22:12:59 +1300
committerOri Bernstein <ori@eigenstate.org>2018-01-21 02:27:09 -0800
commitd8b909066008d478a8abd30cb329c88d44194730 (patch)
tree38306c9aa0a7e7829f4cf4ca3baa5775b7e6421a
parent98235d9673f41003b14a0e8852785c6582fdff8f (diff)
downloadmc-d8b909066008d478a8abd30cb329c88d44194730.tar.gz
Fix some leaks when freeing json
Objects and arrays have an underlying slice All types are an elt allocated with mk
-rw-r--r--lib/json/parse.myr3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/json/parse.myr b/lib/json/parse.myr
index d57d991..3b753a6 100644
--- a/lib/json/parse.myr
+++ b/lib/json/parse.myr
@@ -54,12 +54,15 @@ const free = {j
for e : a
free(e)
;;
+ std.slfree(a)
| &(`Obj o):
for (k, v) : o
std.slfree(k)
free(v)
;;
+ std.slfree(o)
;;
+ std.free(j)
}
const parseelt = {p