Skip to content

lib: unlink the `next` pointer for FixedQueue to avoid potential memory leaks

Rodrigo Muino Tomonari requested to merge github/fork/twchn/fixed_queue into main

In the internal FixedQueue, once a FixedCircularBuffer is used out, it does not unlink the next pointer, thus if a variable references the head or tail field of FixedQueue, it will cause a memory leak. I wrote a reproducing example here. Another way is to make head and tail field private, but we need to modify the test cases in test/parallel/test-fixed-queue.js.

Merge request reports

Loading