Changeset 5315 in webkit for trunk/JavaScriptCore/kjs


Ignore:
Timestamp:
Oct 30, 2003, 12:59:16 PM (22 years ago)
Author:
mjs
Message:

Reviewed by NOBODY (OOPS!).

  • fixed 3427069 - browsing mp3.com causes leaks (KJS)
  • kjs/string_object.cpp: (StringProtoFuncImp::call): Don't do an early return, since that could leak a temporary regexp.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/string_object.cpp

    r4792 r5315  
    277277      if ((reg->flags() & RegExp::Global) == 0) {
    278278        // case without 'g' flag is handled like RegExp.prototype.exec
    279         if (mstr.isNull())
    280           return Null(); // no match
    281         regExpObj->setSubPatterns(reg->subPatterns());
    282         result = regExpObj->arrayOfMatches(exec,mstr);
     279        if (mstr.isNull()) {
     280          result = Null();
     281        } else {
     282          regExpObj->setSubPatterns(reg->subPatterns());
     283          result = regExpObj->arrayOfMatches(exec,mstr);
     284        }
    283285      } else {
    284286        // return array of matches
Note: See TracChangeset for help on using the changeset viewer.