Commit 23d9e7ee authored by Ben Noordhuis's avatar Ben Noordhuis Committed by Jeremiah Senkpiel
Browse files

src: remove extra heap allocation in GetSession()

Don't allocate + copy + free; allocate and fill in place, then hand off
the pointer to Buffer::New().

Avoids unnecessary heap allocations in the following methods:

- crypto.CryptoStream#getSession()
- tls.TLSSocket#getSession()

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


Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
parent fc7d8c02
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