diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 77c6186c9d4..7bf825eca8e 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -264,6 +264,7 @@ Handle SecureContext::Close(const Arguments& args) { if (sc->ctx_ != NULL) { SSL_CTX_free(sc->ctx_); sc->ctx_ = NULL; + sc->ca_store_ = NULL; return True(); } diff --git a/src/node_crypto.h b/src/node_crypto.h index d37a3272a78..9249f5bfa05 100644 --- a/src/node_crypto.h +++ b/src/node_crypto.h @@ -43,11 +43,9 @@ class SecureContext : ObjectWrap { if (ctx_) { SSL_CTX_free(ctx_); ctx_ = NULL; - } - - if (ca_store_) { - X509_STORE_free(ca_store_); ca_store_ = NULL; + } else { + assert(ca_store_ == NULL); } }