Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Commit

Permalink
slashListname leaks to the global scope.
Browse files Browse the repository at this point in the history
slashListname is not defined, but is used within function block scope,
allowing it to be hoisted into the global (window) scope; causing
memory leak.
  • Loading branch information
geedew committed Jan 10, 2013
1 parent 1125487 commit 6e35e9b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion twitter-text.js
Expand Up @@ -780,7 +780,8 @@ if (typeof twttr === "undefined" || twttr === null) {
return [];
}

var possibleNames = [];
var possibleNames = [],
slashListname;

text.replace(twttr.txt.regexen.validMentionOrList, function(match, before, atSign, screenName, slashListname, offset, chunk) {
var after = chunk.slice(offset + match.length);
Expand Down

0 comments on commit 6e35e9b

Please sign in to comment.