buffer: do not leak memory if buffer is too big · nodejs/node@0783ddf · GitHub
Skip to content

Commit 0783ddf

Browse files
kvakildanielleadams
authored andcommitted
buffer: do not leak memory if buffer is too big
A recent pull request changed this method to throw when the buffer was too big, but this meant that the `free` finalizer would never get called, leading to a memory leak. A previous version of this diff included a test provoking this behavior with `v8.serialize`, but it unfortunately kept triggering the OOM killer, so it was removed. Refs: #40243 PR-URL: #43938 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent 8850555 commit 0783ddf

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/node_buffer.cc

Lines changed: 1 addition & 0 deletions

0 commit comments

Comments
 (0)