Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Ijaz Sheikh <ofrobots@google.com>2017-11-09 09:08:13 +0300
committerAli Ijaz Sheikh <ofrobots@google.com>2017-11-17 03:59:54 +0300
commitd37789deeb5e951500d7fb499602dc100d3212fb (patch)
tree4bb60acc9609c0f388da210f9f7dae856c23f534 /src/node_perf.cc
parenteeab7bc0688256247c47099a90c67741e6637e42 (diff)
src: perf_hooks: fix wrong sized delete
Depending on the allocator, existing code leaks memory. PR-URL: https://github.com/nodejs/node/pull/16898 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe>
Diffstat (limited to 'src/node_perf.cc')
-rw-r--r--src/node_perf.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/node_perf.cc b/src/node_perf.cc
index a27a1b3dd76..94c3a0f8e0c 100644
--- a/src/node_perf.cc
+++ b/src/node_perf.cc
@@ -196,7 +196,9 @@ void PerformanceGCCallback(uv_async_t* handle) {
cleanup:
delete data;
- auto closeCB = [](uv_handle_t* handle) { delete handle; };
+ auto closeCB = [](uv_handle_t* handle) {
+ delete reinterpret_cast<uv_async_t*>(handle);
+ };
uv_close(reinterpret_cast<uv_handle_t*>(handle), closeCB);
}