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 78dcf0d

Browse filesBrowse files
bnoordhuisevanlucas
authored andcommitted
src: fix handle leak in UDPWrap::Instantiate()
Create a handle scope before performing a check that creates a handle, otherwise the handle is leaked into the handle scope of the caller. PR-URL: #7711 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
1 parent dc766e6 commit 78dcf0d
Copy full SHA for 78dcf0d

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

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

‎src/udp_wrap.cc‎

Copy file name to clipboardExpand all lines: src/udp_wrap.cc
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,9 @@ void UDPWrap::OnRecv(uv_udp_t* handle,
436436

437437

438438
Local<Object> UDPWrap::Instantiate(Environment* env, AsyncWrap* parent) {
439+
EscapableHandleScope scope(env->isolate());
439440
// If this assert fires then Initialize hasn't been called yet.
440441
CHECK_EQ(env->udp_constructor_function().IsEmpty(), false);
441-
EscapableHandleScope scope(env->isolate());
442442
Local<Value> ptr = External::New(env->isolate(), parent);
443443
return scope.Escape(env->udp_constructor_function()
444444
->NewInstance(env->context(), 1, &ptr).ToLocalChecked());

0 commit comments

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