Skip to content

Instantly share code, notes, and snippets.

@indutny

indutny/1.patch Secret

Created August 19, 2013 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save indutny/c8ee782774d8c54f46b0 to your computer and use it in GitHub Desktop.
Save indutny/c8ee782774d8c54f46b0 to your computer and use it in GitHub Desktop.
commit 306f86343849401ea8b4c5e9e049d0f82286b782
Author: Fedor Indutny <fedor.indutny@gmail.com>
Date: Mon Aug 19 20:34:34 2013 +0400
crypto: don't touch ssl_ in Connection
`ssl_` is a property of SSLWrap class, don't touch it, and definitely
don't zero it in constructor.
diff --git a/src/node_crypto.h b/src/node_crypto.h
index 56055a9..2d2b00a 100644
--- a/src/node_crypto.h
+++ b/src/node_crypto.h
@@ -267,7 +267,6 @@ class Connection : public SSLWrap<Connection>, public ObjectWrap {
: SSLWrap<Connection>(sc, kind),
hello_offset_(0) {
bio_read_ = bio_write_ = NULL;
- ssl_ = NULL;
hello_parser_.Start(SSLWrap<Connection>::OnClientHello,
OnClientHelloParseEnd,
this);
@@ -275,11 +274,6 @@ class Connection : public SSLWrap<Connection>, public ObjectWrap {
}
~Connection() {
- if (ssl_ != NULL) {
- SSL_free(ssl_);
- ssl_ = NULL;
- }
-
#ifdef SSL_CTRL_SET_TLSEXT_SERVERNAME_CB
sniObject_.Dispose();
sniContext_.Dispose();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment