Commit 06f0d78e authored by Stephen Belanger's avatar Stephen Belanger Committed by Node.js GitHub Bot
Browse files

async_hooks: fix leak in AsyncLocalStorage exit

If exit is called and then run or enterWith are called within the
exit function, the als instace should not be added to the storageList
additional times. The correct behaviour is to remove the instance
from the storageList before executing the exit handler and then to
restore it after.

PR-URL: https://github.com/nodejs/node/pull/35779


Reviewed-By: default avatarVladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: default avatarMichael Dawson <midawson@redhat.com>
Reviewed-By: default avatarGerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: default avatarAndrey Pechkurov <apechkurov@gmail.com>
Reviewed-By: default avatarRich Trott <rtrott@gmail.com>
parent 39a7f766
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment