Skip to content

Commit

Permalink
http: Do not free the wrong parser on socket close
Browse files Browse the repository at this point in the history
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
  • Loading branch information
isaacs committed Feb 25, 2013
1 parent f9a0140 commit b0e7dbf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit b0e7dbf

Please sign in to comment.