crypto: fix memory leak in Connection::New
authorFedor Indutny <fedor@indutny.com>
Sat, 23 Aug 2014 19:22:23 +0000 (23:22 +0400)
committerFedor Indutny <fedor@indutny.com>
Sat, 23 Aug 2014 19:22:23 +0000 (23:22 +0400)
Do not create `SSL` instance twice, `SSL_new` is called from `SSLBase`
constructor anyway.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
src/node_crypto.cc

index 03c2d25..9fa1e2c 100644 (file)
@@ -2111,7 +2111,6 @@ void Connection::New(const FunctionCallbackInfo<Value>& args) {
   SSLWrap<Connection>::Kind kind =
       is_server ? SSLWrap<Connection>::kServer : SSLWrap<Connection>::kClient;
   Connection* conn = new Connection(env, args.This(), sc, kind);
-  conn->ssl_ = SSL_new(sc->ctx_);
   conn->bio_read_ = NodeBIO::New();
   conn->bio_write_ = NodeBIO::New();