This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Implement SecureContext destructor

  • Loading branch information...
ry committed Dec 1, 2010
1 parent 3bb61a9 commit 02aaac892bad58487e972a081f816931297c9635
Showing with 10 additions and 1 deletion.
  1. +1 −0 src/node_crypto.cc
  2. +9 −1 src/node_crypto.h
View
@@ -225,6 +225,7 @@ Handle<Value> SecureContext::Close(const Arguments& args) {
if (sc->pCtx != NULL) {
SSL_CTX_free(sc->pCtx);
+ sc->pCtx = NULL;
return True();
}
return False();
View
@@ -39,7 +39,15 @@ class SecureContext : ObjectWrap {
}
~SecureContext() {
- // Free up
+ if (pCtx) {
+ SSL_CTX_free(pCtx);
+ pCtx = NULL;
+ }
+
+ if (caStore) {
+ X509_STORE_free(caStore);
+ caStore = NULL;
+ }
}
private:

0 comments on commit 02aaac8

Please sign in to comment.