From 8e56358e1dab590ac16bc4c180c1bed410e24cd0 Mon Sep 17 00:00:00 2001 From: "antonm@chromium.org" Date: Fri, 30 Apr 2010 10:27:25 +0000 Subject: [PATCH] Use ScopedVector instead of dynamically allocated array. This ensures that it'll be released on any control path leaving the function thanks to desctuctor semantics. BUG=42925 Review URL: http://codereview.chromium.org/1712025 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4554 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/runtime.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/runtime.cc b/src/runtime.cc index c35a1fb..0ac0641 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -4225,7 +4225,7 @@ static Object* Runtime_GetLocalPropertyNames(Arguments args) { int length = LocalPrototypeChainLength(*obj); // Find the number of local properties for each of the objects. - int* local_property_count = NewArray(length); + ScopedVector local_property_count(length); int total_property_count = 0; Handle jsproto = obj; for (int i = 0; i < length; i++) { @@ -4278,7 +4278,6 @@ static Object* Runtime_GetLocalPropertyNames(Arguments args) { } } - DeleteArray(local_property_count); return *Factory::NewJSArrayWithElements(names); } -- 2.7.4