summaryrefslogtreecommitdiffhomepage
path: root/lib/math.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-10-23 10:29:55 +0200
committerJo-Philipp Wich <jo@mein.io>2021-10-23 10:32:56 +0200
commit0f022aae0c6008fe6f2219871d32dca8b9105066 (patch)
treee1ccc24b8b4d61d896db57bfa447202de264f12b /lib/math.c
parent9041e2403d98fdb54206c23bd684a7da6fb63026 (diff)
lib: increase refcount when returning cached module instance
Subsequent requires of the same module returned the cached module instance without increasing the refcount, leading to use-after-free on VM tear down or garbage collection cycles. Solve this issue by properly incrementing the refcount before returning the cached module instance. Fixes: #25 Fixes: 96f140b ("lib, vm: ensure that require() compiles modules only once") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'lib/math.c')
0 files changed, 0 insertions, 0 deletions