From e4dd8dc28efc8bbf8e2adb3d9ce17229db46219b Mon Sep 17 00:00:00 2001 From: isaacs Date: Thu, 3 May 2012 10:20:20 -0700 Subject: [PATCH] http leak: Null links from parser to req/res --- lib/http.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/http.js b/lib/http.js index 7e51ec57581..30285eec63c 100644 --- a/lib/http.js +++ b/lib/http.js @@ -1198,6 +1198,7 @@ function ClientRequest(options, cb) { self._deferToConnect(null, null, function() { self._flush(); + self = null; }); } @@ -1255,12 +1256,17 @@ ClientRequest.prototype.onSocket = function(socket) { var freeParser = function() { if (parser) { - parsers.free(parser); + parser.onIncoming = null; parser.socket.onend = null; parser.socket.ondata = null; parser.socket = null; + parser.incoming = null; + parsers.free(parser); parser = null; } + if (req) { + req.parser = null; + } }; var errorListener = function(err) {