From 4671e54495a29696ae8e5f9bd17ba4c63f5d1b23 Mon Sep 17 00:00:00 2001 From: Stefan Rusu Date: Fri, 3 Feb 2012 18:27:53 +0200 Subject: [PATCH] net: destroy socket on DNS error The socket was never destroyed on DNS errors. This broke some clients, including lib/https.js. --- lib/net.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/net.js b/lib/net.js index 85479412b2d..bdd5ba8fadc 100644 --- a/lib/net.js +++ b/lib/net.js @@ -570,6 +570,7 @@ Socket.prototype.connect = function(port /* [host], [cb] */) { // error event to the next tick. process.nextTick(function() { self.emit('error', err); + self.destroy(); }); } else { timers.active(self);