Reviewers: Yang,

Description:
Changed free(buffer) to delete [] buffer.

This bug (mismatch between new[] and free) was found by running VC++'s /analyze
on all of Chrome.

BUG=427616

Please review this at https://codereview.chromium.org/686193004/

Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+1, -1 lines):
  M src/objects-printer.cc


Index: src/objects-printer.cc
diff --git a/src/objects-printer.cc b/src/objects-printer.cc
index 75e2ed19de27d39012398dad69bc9c90c9abb1bc..b3d7ec7fe3accb84e8f806676170df8173dabcc1 100644
--- a/src/objects-printer.cc
+++ b/src/objects-printer.cc
@@ -595,7 +595,7 @@ char* String::ToAsciiArray() {
   // Static so that subsequent calls frees previously allocated space.
   // This also means that previous results will be overwritten.
   static char* buffer = NULL;
-  if (buffer != NULL) free(buffer);
+  if (buffer != NULL) delete [] buffer;
   buffer = new char[length()+1];
   WriteToFlat(this, reinterpret_cast<uint8_t*>(buffer), 0, length());
   buffer[length()] = 0;


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to