Skip to content

Commit 57b5b01

Browse files
committed
tls: fix leak on invalid protocol method
1 parent 5bd2152 commit 57b5b01

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/crypto/crypto_context.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,10 +1355,8 @@ SecureContext::SecureContext(Environment* env, Local<Object> wrap)
13551355
}
13561356

13571357
inline void SecureContext::Reset() {
1358-
if (ctx_ != nullptr) {
1359-
env()->external_memory_accounter()->Decrease(env()->isolate(),
1360-
kExternalSize);
1361-
}
1358+
env()->external_memory_accounter()->Decrease(env()->isolate(),
1359+
kExternalSize);
13621360
ctx_.reset();
13631361
cert_.reset();
13641362
issuer_.reset();

0 commit comments

Comments
 (0)