Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 17e31dc

Browse filesBrowse files
ofrobotsMylesBorins
authored andcommitted
src: perf_hooks: fix wrong sized delete
Depending on the allocator, existing code leaks memory. PR-URL: #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>
1 parent acf6f24 commit 17e31dc
Copy full SHA for 17e31dc

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Open diff view settings
Collapse file

‎src/node_perf.cc‎

Copy file name to clipboardExpand all lines: src/node_perf.cc
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,9 @@ void PerformanceGCCallback(uv_async_t* handle) {
196196

197197
cleanup:
198198
delete data;
199-
auto closeCB = [](uv_handle_t* handle) { delete handle; };
199+
auto closeCB = [](uv_handle_t* handle) {
200+
delete reinterpret_cast<uv_async_t*>(handle);
201+
};
200202
uv_close(reinterpret_cast<uv_handle_t*>(handle), closeCB);
201203
}
202204

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.