mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
tls: fix leak on invalid protocol method
PR-URL: https://github.com/nodejs/node/pull/60427 Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
@@ -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() {
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user