diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 28421013d04..d7b9a417dc2 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -2622,6 +2622,7 @@ JS_NewExternalString(JSContext *cx, jschar *chars, size_t length, intN type) if (!str) return NULL; str->initFlat(chars, length); + cx->updateMallocCounter(length * sizeof(jschar)); return str; }