Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tls: fix leak of WriteWrap+TLSWrap combination #9626

Closed
wants to merge 1 commit into from

Commits on Nov 15, 2016

  1. tls: fix leak of WriteWrap+TLSWrap combination

    Writing data to TLSWrap instance during handshake will result in it
    being queued in `write_item_queue_`. This queue won't get cleared up
    until the end of the handshake.
    
    Technically, it gets cleared on `~TLSWrap` invocation, however this
    won't ever happen because every `WriteWrap` holds a reference to the
    `TLSWrap` through JS object, meaning that they are doomed to be alive
    for eternity.
    
    To breach this dreadful contract a knight shall embark from the
    `close` function to kill the dragon of memory leak with his magic
    spear of `destroySSL`.
    
    `destroySSL` cleans up `write_item_queue_` and frees `SSL` structure,
    both are good for memory usage.
    
    PR-URL: nodejs#9586
    Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
    indutny committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    7b84ccd View commit details
    Browse the repository at this point in the history