From b0e7dbf2c0bab37018e64d14d176d0236c11cd87 Mon Sep 17 00:00:00 2001 From: isaacs Date: Mon, 25 Feb 2013 09:06:44 -0800 Subject: [PATCH] http: Do not free the wrong parser on socket close This appears to fix #4673. That bug is very hard to reproduce, so it's hard to tell for certain, but this approach is more correct anyway. Hat-tip: @dougwilson --- lib/http.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/http.js b/lib/http.js index 0081432488f..212b8becb92 100644 --- a/lib/http.js +++ b/lib/http.js @@ -1788,7 +1788,8 @@ function connectionListener(socket) { function serverSocketCloseListener() { debug('server socket close'); // mark this parser as reusable - freeParser(parser); + if (this.parser) + freeParser(this.parser); abortIncoming(); }