From 873297753642e77fb556d13a0e4bc228f34171bd Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Thu, 11 Jun 2015 18:45:57 +0200 Subject: [PATCH] tls: fix references to undefined `cb` 5795e835a1021abdf803e1460501487adbac8d7c introduced unintentional copy-paste bug. `cb` is not actually present in those functions and should not be called, the socket should be destroy instead. PR-URL: https://github.com/nodejs/io.js/pull/1951 Reviewed-By: Roman Reiss --- lib/_tls_wrap.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index ede98ee4bf1985..31e755a774f069 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -167,7 +167,7 @@ function oncertcb(info) { return self.destroy(err); if (!self._handle) - return cb(new Error('Socket is closed')); + return self.destroy(new Error('Socket is closed')); self._handle.certCbDone(); }); @@ -192,7 +192,7 @@ function onnewsession(key, session) { once = true; if (!self._handle) - return cb(new Error('Socket is closed')); + return self.destroy(new Error('Socket is closed')); self._handle.newSessionDone();