Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible memory leak in Match.exec() in 4.x branch #433

Closed
SlNPacifist opened this issue Mar 28, 2017 · 1 comment
Closed

Possible memory leak in Match.exec() in 4.x branch #433

SlNPacifist opened this issue Mar 28, 2017 · 1 comment

Comments

@SlNPacifist
Copy link

Here is current 4.x exec function:

Match.prototype.exec = function exec(context) {
  var save = this.checkDepth();
  ...
  if (i === this.count)
    return undefined;
  ...
  this.restoreDepth(save);
};

In some cases checkDepth increases this.maskOffset, but restoreDepth is not called afterwards, since no match was found.
This leads to increasing of this.maskOffset and this.mask array.

@miripiruni
Copy link
Contributor

miripiruni commented Apr 28, 2017

Also this fix was released in v4.4.2, v6.7.1, v7.7.4, v8.6.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants