1
0
mirror of https://github.com/janet-lang/janet synced 2025-01-12 16:40:27 +00:00

Fix memory leak caused by casting error.

janet_abstract_end improperly modified a gc tag.
This commit is contained in:
Calvin Rose 2019-06-30 10:32:52 -05:00
parent a861399ecb
commit 1588359ebc

View File

@ -35,7 +35,7 @@ void *janet_abstract_begin(const JanetAbstractType *atype, size_t size) {
}
void *janet_abstract_end(void *x) {
janet_gc_settype((void *)(janet_gc_header(x)), JANET_MEMORY_ABSTRACT);
janet_gc_settype((void *)(janet_abstract_head(x)), JANET_MEMORY_ABSTRACT);
return x;
}