Bug 869248 - Add missing OOM check when resolving functions; r=Waldo
authorTerrence Cole <terrence@mozilla.com>
Mon, 20 May 2013 15:02:52 -0700
changeset 139582 1fef85af5e015695bce2b7410539a48042614d67
parent 139581 ee2038f4bf0ba336d9dbd33b08c8db9be62c84fe
child 139583 0b4e06782cda2a028b66564210d2b689a272dd59
push idunknown
push userunknown
push dateunknown
reviewersWaldo
bugs869248
milestone24.0a1
Bug 869248 - Add missing OOM check when resolving functions; r=Waldo
js/src/frontend/NameFunctions.cpp
--- a/js/src/frontend/NameFunctions.cpp
+++ b/js/src/frontend/NameFunctions.cpp
@@ -241,16 +241,18 @@ class NameResolver
          * function, so give them a contribution symbol here.
          */
         if (!buf.empty() && *(buf.end() - 1) == '/' && !buf.append("<"))
             return NULL;
         if (buf.empty())
             return NULL;
 
         JSAtom *atom = buf.finishAtom();
+        if (!atom)
+            return NULL;
         fun->setGuessedAtom(atom);
         return atom;
     }
 
     /*
      * Tests whether parents[pos] is a function call whose callee is cur.
      * This is the case for functions which do things like simply create a scope
      * for new variables and then return an anonymous function using this scope.