1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-29 03:19:54 +00:00

Fix memory leaks in marsh.c - missing frees.

This commit is contained in:
Calvin Rose 2018-10-04 17:33:44 -04:00
parent e8a4e83a0d
commit ba82290bae

View File

@ -427,6 +427,8 @@ int janet_marshal(JanetBuffer *buf, Janet x, int flags) {
if (!(status = setjmp(st.err)))
marshal_one(&st, x, flags);
janet_table_deinit(&st.seen);
janet_v_free(st.seen_envs);
janet_v_free(st.seen_defs);
return status;
}
@ -1015,6 +1017,8 @@ int janet_unmarshal(
if (next) *next = nextbytes;
}
janet_array_deinit(&st.lookup);
janet_v_free(st.lookup_defs);
janet_v_free(st.lookup_envs);
return status;
}