Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
tls: fix leak on invalid protocol method
  • Loading branch information
codebytere committed Oct 28, 2025
commit c84fed3bd968710176630abf371ff67fc2eecb48
3 changes: 2 additions & 1 deletion src/crypto/crypto_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1351,7 +1351,6 @@ SecureContext* SecureContext::Create(Environment* env) {
SecureContext::SecureContext(Environment* env, Local<Object> wrap)
: BaseObject(env, wrap) {
MakeWeak();
env->external_memory_accounter()->Increase(env->isolate(), kExternalSize);
}

inline void SecureContext::Reset() {
Expand Down Expand Up @@ -1469,6 +1468,8 @@ void SecureContext::Init(const FunctionCallbackInfo<Value>& args) {
if (!sc->ctx_) {
return ThrowCryptoError(env, ERR_get_error(), "SSL_CTX_new");
}

env->external_memory_accounter()->Increase(env->isolate(), kExternalSize);
SSL_CTX_set_app_data(sc->ctx_.get(), sc);

// Disable SSLv2 in the case when method == TLS_method() and the
Expand Down
Loading