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:
parent
e8a4e83a0d
commit
ba82290bae
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user