Skip to content

Commit 4e33532

Browse files
RaisinTendanielleadams
authored andcommittedMay 31, 2021
src: use HandleScope in StreamReq::Done()
Fixes: #38707 PR-URL: #38720 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 2054efa commit 4e33532

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed
 

‎src/stream_base-inl.h

+1
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ void StreamReq::Done(int status, const char* error_str) {
279279
AsyncWrap* async_wrap = GetAsyncWrap();
280280
Environment* env = async_wrap->env();
281281
if (error_str != nullptr) {
282+
v8::HandleScope handle_scope(env->isolate());
282283
async_wrap->object()->Set(env->context(),
283284
env->error_string(),
284285
OneByteString(env->isolate(), error_str))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
if (!common.hasCrypto)
5+
common.skip('missing crypto');
6+
7+
const https = require('https');
8+
9+
const request = https.get('https://example.com');
10+
11+
request.on('socket', (socket) => {
12+
socket.unref();
13+
});

0 commit comments

Comments
 (0)
Please sign in to comment.