Fixed memory leak in JSDate::JSDatePrint().
authorishell <ishell@chromium.org>
Fri, 5 Jun 2015 11:15:31 +0000 (04:15 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 5 Jun 2015 11:15:42 +0000 (11:15 +0000)
BUG=chromium:496013
LOG=N

Review URL: https://codereview.chromium.org/1163203002

Cr-Commit-Position: refs/heads/master@{#28809}

src/objects-printer.cc

index 35eea77fdf72b0fe90d5087ccfb3212c08f089ca..a5d09eff0a24d58e448a684c867d7cb406a21f70 100644 (file)
@@ -574,7 +574,7 @@ void JSDate::JSDatePrint(std::ostream& os) {  // NOLINT
     os << " - time = NaN\n";
   } else {
     // TODO(svenpanne) Add some basic formatting to our streams.
-    Vector<char> buf = Vector<char>::New(100);
+    ScopedVector<char> buf(100);
     SNPrintF(
         buf, " - time = %s %04d/%02d/%02d %02d:%02d:%02d\n",
         weekdays[weekday()->IsSmi() ? Smi::cast(weekday())->value() + 1 : 0],