src: introduce internal Buffer::Copy() function
authorBen Noordhuis <info@bnoordhuis.nl>
Thu, 13 Aug 2015 11:47:18 +0000 (13:47 +0200)
committerBen Noordhuis <info@bnoordhuis.nl>
Thu, 13 Aug 2015 18:04:56 +0000 (20:04 +0200)
commit9a3929dcbfd835721b514a781cdca1b7fb911cf0
tree6ed4f67c24d15b9681807e0d6bbb455703f076c1
parentb86211a8b62c8f8ba7eed280ce7dcdf7d113cbe9
src: introduce internal Buffer::Copy() function

Rename the three argument overload of Buffer::New() to Buffer::Copy()
and update the code base accordingly.  The reason for renaming is to
make it impossible to miss a call site.

This coincidentally plugs a small memory leak in crypto.getAuthTag().

Fixes: https://github.com/nodejs/node/issues/2308
PR-URL: https://github.com/nodejs/node/pull/2352
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
src/js_stream.cc
src/node_buffer.cc
src/node_crypto.cc
src/node_internals.h
src/tls_wrap.cc