tls_wrap: fix BIO leak on SSL error
authorFedor Indutny <fedor@indutny.com>
Tue, 24 Mar 2015 03:07:03 +0000 (20:07 -0700)
committerFedor Indutny <fedor@indutny.com>
Wed, 25 Mar 2015 22:50:50 +0000 (17:50 -0500)
Fix: https://github.com/iojs/io.js/issues/1075
PR-URL: https://github.com/iojs/io.js/pull/1244
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
src/tls_wrap.cc

index 13ba550..b6b87b3 100644 (file)
@@ -374,7 +374,7 @@ Local<Value> TLSWrap::GetSSLError(int status, int* err, const char** msg) {
           buf[mem->length] = '\0';
           *msg = buf;
         }
-        static_cast<void>(BIO_reset(bio));
+        BIO_free_all(bio);
 
         return scope.Escape(exception);
       }