Skip to content
Browse files

http leak: Null links from parser to req/res

  • Loading branch information...
1 parent 5eac8d6 commit e4dd8dc28efc8bbf8e2adb3d9ce17229db46219b @isaacs isaacs committed May 3, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/http.js
View
8 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) {

0 comments on commit e4dd8dc

Please sign in to comment.
Something went wrong with that request. Please try again.